1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! `path p project` — narrower, file-shaped sibling of `export`.
//!
//! `project claude --input X [--output Y]` writes a toolpath document
//! as a Claude JSONL session, either to a file (`--output`) or to
//! stdout. It's the older, simpler surface; `export claude` is its
//! superset and also accepts `--project <dir>` to overwrite an
//! on-disk session layout.
use anyhow::Result;
use clap::Subcommand;
use std::path::PathBuf;
#[derive(Subcommand, Debug)]
pub enum ProjectTarget {
/// Project a toolpath document into Claude JSONL format
Claude {
/// Input toolpath document (JSON path, or cache id)
#[arg(short, long)]
input: String,
/// Output file (JSONL). Prints to stdout if omitted.
#[arg(short, long)]
output: Option<PathBuf>,
},
}
pub fn run(target: ProjectTarget) -> Result<()> {
match target {
ProjectTarget::Claude { input, output } => {
crate::cmd_export::run(crate::cmd_export::ExportTarget::Claude {
input,
project: None,
output,
})
}
}
}