actx import
actx import
Section titled “actx import”Convert target-format input (SQL, MCP JSON-RPC, REST, GraphQL, SurrealQL, JSON) back into CTX syntax via the Rust N-API sidecar bridge.
actx import --input <path> [--source <format>]echo "SELECT * FROM users" | actx importOptions
Section titled “Options”| Option | Default | Description |
|---|---|---|
--input <path> | — | Input file containing target-format text |
--source <format> | auto-detect | Source format hint: sql, mcp, rest, graphql, surrealql, json |
Description
Section titled “Description”The import command uses the Rust sidecar’s reverseTranslate function to parse structured queries and API calls back into their equivalent CTX statements. If --source is omitted, the format is auto-detected from the input content.
If no --input flag is given and stdin is not a TTY, the command reads from stdin — allowing piped workflows.
Example
Section titled “Example”$ actx import --input query.sql{ "ok": true, "source_format": "sql", "confidence": 0.95, "ctx_output": "?k \"users\" #all", "statements": 1}Error Codes
Section titled “Error Codes”| Code | Meaning |
|---|---|
NAPI_UNAVAILABLE | Rust sidecar native addon not compiled |
INPUT_NOT_FOUND | Input file does not exist or cannot be read |
NO_INPUT | No --input flag and no stdin data |
EMPTY_INPUT | Input file or stdin is empty |
REVERSE_FAILED | Reverse translation engine failed |
See Also
Section titled “See Also”- actx decode — decode binary CTX-B files
- actx query — execute a CTX query