Reference
CLI: command context
Select a workspace, branch, and connection before running data commands.
| Option | Meaning |
|---|---|
--workspace <workspace> | Workspace name, short ID, or full workspace identifier |
--branch <branch> | Branch name or full branch identifier |
--node <node-id> | Node to contact; use its full identifier for graph commands |
--ticket <ticket> | Connection ticket supplied for the target node |
--localhost | Restrict the connection to this machine |
--lan | Look for nodes on the local network |
-C <directory> | Run from another working directory |
--long | Display complete identifiers |
--json | Request machine-readable command output |
Global options may appear before or after a subcommand:
legra --workspace research --branch main graph query 'SELECT * WHERE { GRAPH ?g { ?s ?p ?o } } LIMIT 10'
LEGRA_WORKSPACE and LEGRA_BRANCH supply workspace and branch defaults.
Explicit flags override those defaults. LEGRA_NODE and LEGRA_TICKET can
provide connection settings.
To save a workspace selection for your current directory:
legra workspace use research
legra workspace current
workspace use writes the selection to .env.local. Check the current
workspace before changing data or membership. Uploads use
--target-branch to choose their destination.
Query result formats are selected with --format.
For connection troubleshooting, see Connecting to Legra.