Skip to content

Add an 'spk config' command - #1406

Open
jrray wants to merge 1 commit into
mainfrom
spk-config-command
Open

Add an 'spk config' command#1406
jrray wants to merge 1 commit into
mainfrom
spk-config-command

Conversation

@jrray

@jrray jrray commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Adds spk config, mirroring the existing spfs config command.

It prints the effective spk configuration — after the system file, the user
file, and environment variable overrides have all been merged — as
pretty-printed json. Today there is no way to check what spk actually resolved
its settings to other than inferring it from behavior.

$ spk config
{
  "sentry": { ... },
  "solver": {
    "check_impossible_initial": false,
    ...
  },
  ...
}

Placement

The command lives in spk-cli-group4 alongside the other small informational
commands (version, lint, search, view).

That crate turns out to sit on the tail of the build's critical path —
spk-cli-group2 rmeta → spk-cli-group4spk link — with nothing else
gating the final link, so the placement was measured rather than assumed:

baseline with spk config
from-scratch cargo build -p spk 101.1s 94.7s
spk-cli-group4 unit 5.9s 5.7s

Since that spread is all noise, the crate was isolated (deps warm,
cargo clean -p spk-cli-group4, CARGO_INCREMENTAL=0, 3 reps each):
baseline mean 6087ms vs. 6055ms with the change — −32ms against a ±250ms
run-to-run spread
, i.e. unmeasurable.

That matches the structure: the new module is 30 lines with no generics or
macro expansion, and the spk-config dependency added to group4's
Cargo.toml is a new direct edge to a crate that was already present
transitively and finishes ~58s before group4 starts — it adds no node to the
graph and lengthens no path.

Worth knowing for later, though: anything heavier landing in group4 goes
straight onto the critical path's tail.

Also

  • Documents both spfs config and spk config in docs/admin/config.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XsbWihJL8svBWeeKHNL2j9

Mirrors 'spfs config': prints the effective spk configuration, after the
system file, user file, and environment variable overrides have all been
merged, as pretty-printed json. This gives users a way to check what spk
actually resolved its settings to, which is otherwise only inferable from
behavior.

The command lives in spk-cli-group4 alongside the other small
informational commands. That crate sits on the tail of the build's
critical path (spk-cli-group2 rmeta -> spk-cli-group4 -> spk), so the
placement was measured rather than assumed: across from-scratch builds
and repeated cold rebuilds of the crate, the added module moves the
group4 compile by -32ms against a +/-250ms run-to-run spread. The
spk-config dependency added here is a new direct edge to a crate that
was already present transitively and finishes ~58s before group4 starts,
so it adds no node to the graph and lengthens no path.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XsbWihJL8svBWeeKHNL2j9
@jrray jrray self-assigned this Sep 2, 2026
@jrray jrray added enhancement New feature or request AI Code authored with AI assistance. labels Sep 2, 2026
@jrray

jrray commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator Author

I noticed an LLM looking for a spk config command while working on something and figured we might as well have one.

@jrray
jrray requested a review from dcookspi September 2, 2026 23:08
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/spk-cli/group4/src/cmd_config.rs 0.00% 5 Missing ⚠️
crates/spk/src/cli.rs 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Code authored with AI assistance. enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant