Xihl Editor v0.3 · macOS ARM64
XIHL / Editor

CLI and agent use

See aligner profiles and index preparation for typed CLI and MCP examples.

Guide contents · Command reference · MCP setup

dna-cli exposes domain operations without a display or file picker. A licensed Mac uses the same offline startup check as the desktop. Use explicit input/output paths and inspect returned source revisions, limits and effects. An agent can compose operations; it does not need to simulate mouse gestures to inspect a sequence or run a supported analysis.

Discover the current contract

dna-cli --version
dna-cli --help
dna-cli capabilities
dna-cli schemas
dna-cli document-edit --help

The v0.2 preview lists 119 domain commands. The generated reference captures their declared arguments and desktop counterparts. capabilities.result.commands supplies availability, prerequisites and input/output pointers. Resolve those JSON Pointers inside the schemas response. CLI definitions are local descriptive schemas; do not assume they declare an external JSON Schema dialect. Typed workflow requests are externally tagged enum objects. Use exact variant/field names from discovery.

Branding is Xihl Editor; dna-cli, dna-editor-desktop and some result headers remain compatibility names. For source use in a configured cached checkout, prefix commands with cargo run --offline -p dna-cli --.

Local licensing status

dna-cli license status
dna-cli license status --check-certificate
dna-cli discover --command license

Use --check-certificate to check the installed license offline. A result of valid means this Mac can start the licensed version. These diagnostics are available even when normal startup is refused. An activation-free build reports its build mode with license status. The installation guide explains activation, administrator approval, updates and recovery.

Export a certificate from a private Mac build

The licensed Mac test build can also redeem a code into a certificate file. Use dna-cli license --help for the available options. A paid export requires explicit credit authorization and takes the code from a private file. Choose a new output path. Exporting and installing are separate steps. Use Import saved certificate… in the editor to install an exported file on the same Mac.

Inputs, outputs and errors

Commands emit one versioned JSON success/error on stdout. Progress and diagnostics use stderr. --help and --version are human-readable exceptions. Keep both exit status and JSON; do not treat an error object as a successful empty result.

Newer commands use schema_version, command, optional request_id, and result. Some legacy commands retain top-level fields: for example, inspect returns records, not result.records. Error envelopes also have legacy/newer differences; use the command's discovered output definition. Add --request-id YOUR_ID when correlating a call. Error details may be empty.

ExitMeaning
0Success
2Usage/argument refusal
3Input problem
4Output/publication problem
5Processing failure
6Revision/conflict refusal
7Partial batch result; inspect each item
130Cancellation

Small sequence options that advertise stdin accept --input - (or supported --left, --right, sequence --reference) as UTF-8 FASTA, at most1MiB. JSON --request - is similarly bounded. One command consumes at most one stdin stream; terminal stdin is refused. Project import, large data and artifact paths require real filesystem locations. Results stay JSON; --output - is not a raw sequence stdout mode. For example:

dna-cli inspect --input - < first-project.fasta

Choose unused output files/directories. Use overwrite only when a command advertises it and you intend replacement. A project mutation requires explicit update and the current saved project checkpoint revision. project-inspect returns that token; a per-record history revision is not interchangeable with it. Dry-run is read-only where supported. A multi-operation document edit uses coordinates relative to each preceding candidate state, then publishes atomically after all operations succeed. Do not overwrite an unsaved desktop session from an agent without coordinating it.

Small sequence recipes

From the repository root, using the portable examples:

dna-cli sequence-stats --input first-project.fasta
dna-cli sequence-search --input first-project.fasta --motif CCCC
dna-cli translate --input first-project.fasta --start 0 --end 12
dna-cli fastq-qc --input docs/user-guide/examples/two-reads.fastq --output-dir NEW_QC_DIRECTORY --threads 1 --memory-mb 64

Expected observations: length16/GC fraction0.5; one forward motif at [4,8); protein KTPG from the first12bases under defaults; QC2reads/12bases, lengths4–8, mean length6, first four per-position mean qualities21 and remaining four40. These are small examples you can run with unused output paths.

The first-project recipe covers explicit copy import, saved-revision guards, reopening and GenBank export. Use the reference guide for typed workflow descriptors, registration and interval queries. Workflow guidance maps analysis families to commands; do not infer unsupported scientific meaning from a successful JSON envelope.

Durable jobs

workflow-plan is typed preflight. workflow-run runs in the foreground. jobs-submit accepts a supported request into the durable local job store and returns an ID promptly; the worker can outlive the invoking CLI/MCP connection. Use one explicit job-store location for every CLI call in a run, for example:

export DNA_EDITOR_JOBS_DIR="/absolute/path/to/my-job-state"
dna-cli workflow-plan --request qc-request.json
dna-cli jobs-submit --request qc-request.json
dna-cli jobs-status --job-id RETURNED_ID
dna-cli jobs-wait --job-id RETURNED_ID --timeout-ms 1000
dna-cli jobs-logs --job-id RETURNED_ID --max-lines 40 --max-bytes 16384
dna-cli jobs-results --job-id RETURNED_ID

Replace placeholders, then create qc-request.json with real absolute paths and an unused output location:

{"schema_version":1,"request":{"FastqQc":{"fastq_path":"/absolute/path/two-reads.fastq","output_dir":"/absolute/path/new-qc-result","cpu_threads":1,"memory_limit_mb":64}}}

Treat queued/running as ongoing and inspect terminal completed, failed, cancelled or interrupted. The durable worker limit is one. jobs-list pages results; jobs-wait has a bounded wait, not a guarantee of completion by its timeout. jobs-cancel signals the recorded job cancellation token, not an arbitrary PID. After worker loss, jobs-reconcile detects stale heartbeat state; it does not resume a terminal stage. jobs-retry creates a new attempt linked to the original, with existing workflow/output safety rules. Inspect what committed and the reason for failure before retrying. Preserve completed outputs and source bytes.

Cancelling an MCP request or disconnecting the client does not cancel a durable job already accepted by the server. A lost acknowledgment can mean work was accepted: list/status/reconcile first, rather than duplicating a submission or mutation.

Provenance and reproducibility

Keep the request, input identities, saved record revision, parameters, exact tool identities and result descriptor/bundle. workflow-register is an explicit revision-guarded mutation after a completed descriptor. Inspect complete/stale and truncation/continuation fields. History/replay export has explicit redaction and input/tool requirements; review free-form notes before sharing. See formats and transfers.

Use the read-only selection-transform command (MCP xihl_selection_transform) on a saved record. Supply --project PATH --record-id ID and either --feature-id ID or --segments '8..12,0..3' --strand forward. Segment coordinates are 0-based, half-open, in forward-reference order even on the reverse strand. Use --operation invert for a circular arc or --operation five-prime --count 3 (or three-prime) to slice inside a selection. Pass the returned document_revision as --expected-revision to reject a changed source.