Skip to content

Commit ffc7ad7

Browse files
aksOpsclaude
andcommitted
Rename CLI to code-iq, add version command, fix beta versioning
- CLI: code-iq is now the primary command (code-intelligence still works) - code-iq version: shows version, detector count, language count - Beta versioning: 0.1.0-beta.0 display / 0.1.0b0 PEP 440 Resets on each tagged release (v0.2.0 → 0.2.0-beta.0) - Release notes include install instructions with code-iq CLI examples Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent dc80b01 commit ffc7ad7

3 files changed

Lines changed: 50 additions & 8 deletions

File tree

.github/workflows/beta.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,16 @@ jobs:
3939
else
4040
BETA_NUM=$(git rev-list HEAD --count)
4141
fi
42-
VERSION="${BASE}.dev${BETA_NUM}"
42+
# PEP 440 beta: 0.1.0b0, 0.1.0b1, ...
43+
PEP_VERSION="${BASE}b${BETA_NUM}"
44+
# Display: 0.1.0-beta.0, 0.1.0-beta.1, ...
45+
DISPLAY_VERSION="${BASE}-beta.${BETA_NUM}"
4346
SHORT_SHA=$(git rev-parse --short HEAD)
44-
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
45-
echo "tag=v${VERSION}" >> "$GITHUB_OUTPUT"
47+
echo "version=$PEP_VERSION" >> "$GITHUB_OUTPUT"
48+
echo "display=$DISPLAY_VERSION" >> "$GITHUB_OUTPUT"
49+
echo "tag=v${DISPLAY_VERSION}" >> "$GITHUB_OUTPUT"
4650
echo "sha=$SHORT_SHA" >> "$GITHUB_OUTPUT"
47-
echo "Beta version: $VERSION (${SHORT_SHA})"
51+
echo "Beta version: $DISPLAY_VERSION ($PEP_VERSION) @ ${SHORT_SHA}"
4852
4953
- name: Patch version in pyproject.toml
5054
env:
@@ -80,11 +84,23 @@ jobs:
8084
- name: Create beta release with wheel
8185
env:
8286
BETA_TAG: ${{ steps.version.outputs.tag }}
83-
BETA_VERSION: ${{ steps.version.outputs.version }}
87+
BETA_DISPLAY: ${{ steps.version.outputs.display }}
88+
BETA_PEP: ${{ steps.version.outputs.version }}
8489
BETA_SHA: ${{ steps.version.outputs.sha }}
8590
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8691
run: |
8792
gh release create "$BETA_TAG" dist/* \
88-
--title "Beta $BETA_VERSION ($BETA_SHA)" \
89-
--notes "Auto-generated beta build from commit $BETA_SHA. Install with: pip install https://github.com/RandomCodeSpace/code-iq/releases/download/$BETA_TAG/code_intelligence-${BETA_VERSION}-py3-none-any.whl" \
93+
--title "$BETA_DISPLAY ($BETA_SHA)" \
94+
--notes "Auto-generated beta build from commit $BETA_SHA.
95+
96+
**Install:**
97+
\`\`\`bash
98+
pip install https://github.com/RandomCodeSpace/code-iq/releases/download/${BETA_TAG}/code_intelligence-${BETA_PEP}-py3-none-any.whl
99+
\`\`\`
100+
101+
**Or with code-iq CLI:**
102+
\`\`\`bash
103+
code-iq version
104+
code-iq analyze /path/to/repo
105+
\`\`\`" \
90106
--prerelease

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ kuzu = ["kuzu>=0.6"]
3131
all-backends = ["kuzu>=0.6"]
3232

3333
[project.scripts]
34+
code-iq = "code_intelligence.cli:app"
3435
code-intelligence = "code_intelligence.cli:app"
3536

3637
[project.entry-points."code_intelligence.detectors"]

src/code_intelligence/cli.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,38 @@
1111
from code_intelligence.config import Config
1212

1313
app = typer.Typer(
14-
name="code-intelligence",
14+
name="code-iq",
1515
help="Intelligent code graph discovery and analysis CLI.",
1616
no_args_is_help=True,
1717
)
1818
console = Console()
1919

2020

21+
def _get_version() -> str:
22+
"""Get package version from metadata."""
23+
try:
24+
from importlib.metadata import version
25+
return version("code-intelligence")
26+
except Exception:
27+
return "0.1.0"
28+
29+
30+
@app.command()
31+
def version() -> None:
32+
"""Show version information."""
33+
ver = _get_version()
34+
from code_intelligence.detectors.registry import DetectorRegistry
35+
r = DetectorRegistry()
36+
r.load_builtin_detectors()
37+
console.print(f"code-iq v{ver}")
38+
console.print(f" Detectors: {len(r.all_detectors())}")
39+
langs = set()
40+
for d in r.all_detectors():
41+
for l in d.supported_languages:
42+
langs.add(l)
43+
console.print(f" Languages: {len(langs)}")
44+
45+
2146
def _load_config(config: Path | None, project_path: Path | None = None) -> Config:
2247
return Config.load(config, project_path=project_path)
2348

0 commit comments

Comments
 (0)