CLI profiles and local settings
A profile stores a workspace API URL and your preferred environment. Profiles make it easier to switch between workspace installations without editing application code. Credentials are stored separately from profiles.
On this page
Set up a profileUse environment variablesUnderstand local and hosted selectionLocal files and loggingCredentials and organization selectionSet up a profile
dagy configThe interactive menu creates, edits, deletes, and selects profiles. Enter the API URL supplied for your workspace, choose a default profile, and optionally select an environment and table-output style. Then sign in:
dagy login --profile work
dagy env use develop --profile work
dagy env current --profile workdagy login saves credentials but does not create an API profile. Set up a profile or DAGY_API_URL before deploying. whoami shows saved identity information; it does not check token validity with the server.
To override a profile for one command:
dagy flows list --profile work
dagy -e staging deployments list --profile workUse environment variables
For a shell or application process:
export DAGY_API_URL="https://api.dagy.io/app"
export DAGY_ENVIRONMENT="develop"Use your workspace's actual base URL if it differs. DAGY_API_URL includes any path prefix required by that installation. For the hosted default, API paths such as /runs are appended to /app.
| Setting | Resolution, from highest to lowest priority |
|---|---|
| API URL | Explicit SDK override where supported, DAGY_API_URL, active profile's api_url |
| Profile | A command's --profile, DAGY_PROFILE, configured default, first available profile |
| Environment | Supported command/SDK override, DAGY_ENVIRONMENT, profile's environment, develop |
| Login web app | DAGY_APP_URL, profile's app_url, https://dagy.io |
A requested profile name that does not exist can fall back to the first configured profile. Confirm the selected API URL and environment before deployment. Global -e precedes the subcommand; some commands, including run, backfill, and schedules create, also accept their own --environment option. Use the leaf command's option for those commands.
DAGY_API_URL overrides all named profiles. Unset it when you intend --profile to select a different URL. SDK Flow.run() does not apply an environment selector to its hosted request; use a deployment run request with an explicit environment when environment selection matters.
The SDK does not automatically load .env files. Export settings in your shell or load them explicitly in your application's configuration layer.
Understand local and hosted selection
| Operation | With a configured API URL | Without one |
|---|---|---|
flow.run_local() | Local | Local |
flow.run() | Hosted trigger by flow name | Local |
flow.deploy() | Hosted deployment | Local execution |
dagy run TARGET | TARGET is a deployment name | TARGET is file.py:flow_function |
dagy runs list | Hosted listing | Local listing |
dagy runs list --local | Local listing | Local listing |
dagy runs show / dagy logs | Local files only | Local files only |
There is no dagy run --local option. Call .run_local() from Python to guarantee local execution after configuring a hosted workspace.
Local files and logging
| Variable | Default | Purpose |
|---|---|---|
DAGY_LOCAL_DIR | ~/.dagy | Local run history, logs, artifacts, profiles, and saved credentials |
DAGY_LOCAL_ARTIFACT_MAX_BYTES | 5242880 (5 MiB) | Maximum size of each local output artifact |
DAGY_LOCAL_VERBOSE | false | Enables verbose local logging for 1, true, yes, or on |
DAGY_PROFILE | Configured default | Default CLI profile |
DAGY_APP_URL | Hosted web app | Browser sign-in destination for a custom workspace installation |
For project-isolated local runs:
export DAGY_LOCAL_DIR="$PWD/.dagy"Add .dagy/ to your project's .gitignore. Changing the local directory also changes which profiles and credentials the CLI reads. Build artifacts default to ~/.dagy/builds independently; use build_artifact(..., output_dir="dist") or dagy build --output-dir dist to control build output.
The local runner retains the last 20 runs by default. Customize with flow.run_local(cleanup_keep_last=50). Artifact serialization and size errors can leave a successful task without a persisted output; inspect warnings before relying on reuse of that output.
Credentials and organization selection
CLI credentials are shared by profiles within the same DAGY_LOCAL_DIR; a profile does not create a separate credential vault. Signing into another organization replaces the saved CLI identity. The SDK sends the organization ID saved during login with its requests.
The CLI attempts to restrict profile and credential files to owner-only access. Keep these files out of source control and backups that are shared with others. For automation, follow the API-key guide and keep keys in your CI secret store. The SDK has no DAGY_API_KEY setting; do not assume setting an arbitrary environment variable changes its authentication headers.
Use dagy logout to delete local credentials and request best-effort server revocation when an API URL is configured. Log in again if a token expires or access changes.