CLI (aidf)

aidf is a command-line tool for using AI Data Foundry from a terminal or a script. It uploads local documents to a project for analysis and downloads the results, and it lets you view, edit, and test-run workflows.

Run the same executable as aidf mcp and it becomes an MCP server for LLM clients. To register it in a client such as Claude Desktop or Cursor, see MCP Server Integration.


Prerequisites

  • You need an API key. Create one under User Menu > API Keys. See Authentication for the full procedure.
  • An API key acts with the permissions of the user who created it. That user needs the following permissions in the target project. The project owner has all permissions.
Task Required permission
Upload and run documents, get results All data access (data.access.all)
Create or change workflows, turn auto run on or off, test runs Edit and run flows (flow.edit_run)
  • The target project needs an active workflow for documents to be processed. Create one in the web console (Creating a Workflow) or with aidf flow use parse as shown in Log in below.
  • You need a terminal to enter the API key.

Supported platforms are macOS (Apple Silicon and Intel), Linux (x86_64 and arm64), and Windows (x64 and ARM64). It is a single executable with no runtime dependencies.


Installation

Enter the following sentence as is in a coding agent that can run shell commands (Claude Code, Codex CLI, Cursor Agent, and so on).

Read https://synapfoundry.ai/static/mcp/install.md and install the aidf CLI

The agent reads the installation instructions and performs these steps in order.

  1. Detects the OS and architecture, downloads the matching executable, and verifies its checksum.
  2. Installs aidf and adds it to your PATH. (~/.local/bin on macOS/Linux, %LOCALAPPDATA%\Programs\aidf on Windows)
  3. Asks you to run aidf login in a terminal. You do this step yourself. See Log in below.
  4. Runs aidf projects to check that your projects are listed and reports the result.

To register it in an MCP client at the same time, add the client name to the sentence. For example: Read …install.md, install aidf and register it as an MCP server in Claude Desktop. If aidf is already installed, this sentence does not register it. In that case, register it yourself by following MCP Server Integration > Registering Manually.

The agent never takes the API key through the conversation or a command argument. You type the key directly at the login prompt in your terminal.
The installation instructions contain every command, so you can also follow them yourself without an agent.

Log in

After the installation, run the following commands in your own terminal.

aidf login                      # type your API key at the prompt (input is hidden)
aidf projects                   # list the projects you own
aidf config set project <id>    # save the default project (publicId)
aidf flow active                # check the active workflow
aidf flow use parse             # run once in a new project that has no active workflow
  • aidf login stores the key in the OS key store. On systems without a key store, such as headless Linux, it stores the key in a file that only you can read. The CLI and the MCP server share this key.
  • In scripts you can pass the key on standard input, as in echo "$KEY" | aidf login. Do not pass the key as a command argument.
  • aidf projects lists only the projects you own. Projects you were invited to as a member do not appear, so take the 10-character project ID from the web console address (/workspace/projects/<project ID>/…) and save it with aidf config set project.
  • aidf flow use parse creates a document-analysis workflow and makes it active only when the project has no active workflow. If one already exists, it prints that workflow's ID instead.

Usage

Analyzing documents

aidf parse uploads documents, runs the workflow, waits for processing to finish, and downloads the results in one step.

aidf parse contract.pdf --dest out

The results are saved in a folder named after each file under the --dest folder (out/contract/).

  • You can pass several files at once, or a folder (only the files directly inside it) or a pattern such as *.pdf.
  • If you already processed a file in the same project from this computer, it is not uploaded again and you get the earlier results. To analyze it again after changing the workflow, add --force.
  • Running a workflow consumes credits, just like running it from the web console.
  • If processing does not finish within 3 minutes, or the workflow has a review step, the command prints the document UUID and exits. Run the same command again, or use aidf wait and aidf result, to get the results later. You can change the wait time with --timeout (in seconds).

To upload and get the results separately, use these commands. Use them when you upload many documents first and collect the results later, or when another script checks the processing status.

Command Description
aidf submit <file…> Uploads the files and starts processing, then prints the document UUID without waiting for completion.
aidf wait <uuid…> Waits until processing ends. It does not download the results; the exit code tells you whether it succeeded, failed, is waiting for review, or timed out.
aidf status <uuid> Checks the current status once.
aidf result <uuid> Downloads the results and extracts them under --dest.

Workflows

A workflow defines how uploaded documents move through Input → Analyze → Classify → Review → Result. Instead of Edit workflow in the web console, you can check the active workflow, change its configuration from a YAML file, and test-run it without affecting production documents, all from the terminal.

Command Description
aidf flow list Lists the project's workflows. The active workflow is marked with *.
aidf flow active Shows the current active workflow.
aidf flow describe Prints the workflow configuration as YAML. Without an ID, it prints the active workflow.
aidf flow apply <file> Changes the workflow configuration to match a YAML file. With --dry-run, it saves nothing and prints only the validation result and the changes.
aidf flow test --active <file> Test-runs the active workflow on one file and waits until it finishes. Production documents and auto run are not affected, and the test document is saved in the project's "테스트" (Test) folder.
aidf flow traces <flowId> Lists the workflow's run history. To see the status and errors of each stage in one run, use aidf flow trace <flowId> <traceId>.

For every command, including document and folder management, categories, and run control (aidf jobs resume-all and stop-all), run aidf help. For a command's options, run aidf <command> -h.

Output format and exit codes

Use these options and exit codes to check the outcome of aidf from shell scripts or CI.

  • Add --json to print results and errors as JSON.
  • Add --quiet to turn off notices. Errors are still printed.
  • The exit code tells the outcome.
Exit code Meaning
0 Success
1 General error (document processing failed, server 403 or 5xx, and so on)
2 Input error (unknown command or argument, no active workflow, and so on)
3 Authentication failed (no API key, 401)
4 Waiting for review
5 Timed out (run the same command again to keep waiting)
6 Conflict (server 409 and so on)
7 Connection failed (the request did not reach the server, for example because of a network error)

Configuration

The CLI and the MCP server share the same configuration. The environment variables below take precedence over saved values. All environment variable names start with AIDF_.

Item Saved with Environment variable
API key aidf login AIDF_API_KEY
Default project aidf config set project <id> AIDF_DEFAULT_PROJECT_ID

Set AIDF_API_KEY only where aidf login is not available, such as CI or a secret manager that injects the key. Check the saved values with aidf config list.

Other settings

Environment variable Default Description
AIDF_POLL_TIMEOUT 180 Maximum time to wait for one document to finish (seconds)
AIDF_OUTPUT_DIR OS temporary folder Where the MCP server saves result files
AIDF_RESULT_TTL 86400 How long the MCP server keeps result files before deleting them automatically (seconds)
AIDF_MAX_RESULT_BYTES 1073741824 Maximum size for downloading and extracting results (bytes, 1 GiB)
AIDF_UPDATE_CHECK true Whether to check for new versions (false turns it off)

Updating

aidf update --check     # only check whether a new version exists
aidf update             # replace it with the new version

Your saved key and settings stay as they are, so you do not need to log in again. If you use it from an MCP client, restart the client after the update.

  • Regular commands check for a new version once a day and print a notice when one exists. Turn this off with --quiet or AIDF_UPDATE_CHECK=false.
  • If your version has no aidf update, enter the installation sentence in the agent again. The agent finds the existing installation and replaces only the executable.

Switching from adf-mcp to aidf

If you used adf-mcp before, give your agent the sentence from Installation as is. The agent switches you to aidf in this order.

  1. Installs aidf and asks you to run aidf login in a terminal. The agent does not move the API key from the old configuration file, so type it at the login prompt yourself.
  2. Moves any default project or server address from the old registration with aidf config set.
  3. Changes the old MCP registration to aidf mcp and removes the API key left in the configuration.
  4. Asks whether to delete the old executable and deletes it only if you agree.

aidf reads only environment variables that start with AIDF_. If your shell or CI sets variables with old names such as ADF_API_KEY, rename them, for example to AIDF_API_KEY.


Security

With an API key, anyone can upload and delete documents and change and run workflows with the permissions of the user who issued it. Follow these rules so the key is not exposed to others.

Security Guidelines

  • Enter the API key only in the input that appears when you run aidf login. If you put the key in a message to an agent or after a command, it stays in the conversation or terminal history.
  • When you finish on a shared computer, remove the saved key with aidf logout. A key set in the AIDF_API_KEY environment variable is not removed by this, so remove it separately.
  • Delete keys you no longer use under User Menu > API Keys.

aidf does not collect usage statistics. Requests sent to the server carry a User-Agent that tells the version and environment (aidf/<version> (<OS>/<arch>; cli|mcp)).


Troubleshooting

Symptom Action
Download or checksum verification fails during installation Your network or proxy (https_proxy) settings may have kept the file from downloading correctly. Check the settings and install again.
"Unidentified developer" warning on macOS macOS quarantines executables downloaded from the internet and shows this warning. Remove the quarantine attribute with xattr -d com.apple.quarantine <path to aidf>, then run it again.
aidf: API 키가 없습니다 ("no API key", exit code 3) No API key is saved. Run aidf login in a terminal to save one.
AIDF 인증 실패(401) ("AIDF authentication failed") The saved key may have been deleted or expired. Check its status under User Menu > API Keys, and if you created a new key, save it again with aidf login.
Your project does not appear in aidf projects This list shows only projects you own. For a project you joined as a member, save the project ID from the web console address with aidf config set project.
An error says there is no active workflow The project has no active workflow. Check with aidf flow active, and if there is none, create one with aidf flow use parse.
403 permission error The user who issued the API key lacks permissions in the target project. Ask the project administrator whether you have the permissions listed in Prerequisites.

If this does not help, let us know through the feedback form.


See Also