Skip to content

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.

Terminal window
actx import --input <path> [--source <format>]
echo "SELECT * FROM users" | actx import
OptionDefaultDescription
--input <path>Input file containing target-format text
--source <format>auto-detectSource format hint: sql, mcp, rest, graphql, surrealql, json

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.

Terminal window
$ actx import --input query.sql
{
"ok": true,
"source_format": "sql",
"confidence": 0.95,
"ctx_output": "?k \"users\" #all",
"statements": 1
}
CodeMeaning
NAPI_UNAVAILABLERust sidecar native addon not compiled
INPUT_NOT_FOUNDInput file does not exist or cannot be read
NO_INPUTNo --input flag and no stdin data
EMPTY_INPUTInput file or stdin is empty
REVERSE_FAILEDReverse translation engine failed