Docs Features

cpk config

cpk config manages the .codepakt/config.json file in your project root. This file tells the CLI where the server is and which project is active.

cpk config show

Display the current configuration.

cpk config show
{
  "url": "http://localhost:41920",
  "project_id": "proj_abc123"
}

If no config file exists in the current directory or any parent directory:

No project configured. Run `cpk init` first.

cpk config set

Set a configuration value.

cpk config set <key> <value>

Valid keys:

KeyDescription
urlServer URL. Change this when pointing at a remote or non-default-port server.
project_idActive project ID. Set automatically by cpk init. Rarely changed manually.

Examples:

Point at a remote server:

cpk config set url http://192.168.1.10:41920

Set a non-default port locally:

cpk config set url http://localhost:8080

Config file format

The config file is plain JSON at .codepakt/config.json:

{
  "url": "http://localhost:41920",
  "project_id": "proj_abc123"
}

You can edit it directly if preferred. The CLI reads it on every command — there’s no caching.

Config resolution order

When the CLI needs a config value, it checks in this order:

  1. Environment variable (e.g., CPK_PORT overrides the port in url)
  2. .codepakt/config.json in the current directory
  3. Built-in defaults (url: http://localhost:41920)

For agent identity:

  1. --agent flag on the command
  2. CPK_AGENT environment variable
  3. (error — commands that require agent identity will fail)

Agent identity is not stored in config — use the --agent flag or CPK_AGENT env var.