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:
| Key | Description |
|---|---|
url | Server URL. Change this when pointing at a remote or non-default-port server. |
project_id | Active 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:
- Environment variable (e.g.,
CPK_PORToverrides the port inurl) .codepakt/config.jsonin the current directory- Built-in defaults (
url: http://localhost:41920)
For agent identity:
--agentflag on the commandCPK_AGENTenvironment variable- (error — commands that require agent identity will fail)
Agent identity is not stored in config — use the --agent flag or CPK_AGENT env var.
Related
- CLI Overview — full environment variable reference