-
Notifications
You must be signed in to change notification settings - Fork 0
Add 30 manual verification flows for comprehensive CLI testing #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Covers all major functionality areas: SchLib (6 flows), PcbLib (6 flows), SchDoc editing and analysis (8 flows), PcbDoc board operations (5 flows), PrjPcb project management (2 flows), query languages (2 flows), and cross-cutting features like inspect, JSON output, and shell completions (1 flow). https://claude.ai/code/session_01WwDHQFPm8vrsJoS2ptPmSf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11a6c8896a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| cargo run -p altium-cli -- schlib add-line /tmp/test_flow3.SchLib "IC1" -30 0 -40 0 | ||
|
|
||
| # 4. Add a polygon | ||
| cargo run -p altium-cli -- schlib add-polygon /tmp/test_flow3.SchLib "IC1" "0,50 -10,40 10,40" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use comma-only vertex list for schlib add-polygon
In cmd_add_polygon (crates/altium-format/src/ops/schlib.rs) the vertices string is parsed by splitting on commas only, so the example "0,50 -10,40 10,40" yields tokens like "50 -10" that fail unit parsing and the command errors. As written, Flow 3 will stop at step 4; use a flat comma-separated list like 0,50,-10,40,10,40 or insert commas between every number.
Useful? React with 👍 / 👎.
| cargo run -p altium-cli -- schlib create /tmp/test_flow4.SchLib | ||
|
|
||
| # 2. Generate IC symbol with named pins | ||
| cargo run -p altium-cli -- schlib gen-ic /tmp/test_flow4.SchLib "ATtiny85" --pins "VCC,PB0,PB1,PB2,PB3,PB4,RESET,GND" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix gen-ic pin definition format
The schlib gen-ic parser (parse_pin_defs in crates/altium-format/src/ops/schlib.rs and the GenIc CLI docs in crates/altium-cli/src/commands/schlib.rs) requires each pin as designator:name:type[:side]. Passing only names (VCC,PB0,…) triggers “Invalid pin spec” and the flow cannot proceed; use e.g. 1:VCC:power:left etc. This same pattern appears in later flows that use gen-ic.
Useful? React with 👍 / 👎.
| # 3. Add from JSON | ||
| cargo run -p altium-cli -- schlib add-json /tmp/test_flow6.SchLib /tmp/component_def.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass JSON file via --file for add-json
SchLibCommands::AddJson accepts only --file or --json (crates/altium-cli/src/commands/schlib.rs); it does not take a positional JSON path. This invocation will be rejected as an unexpected argument, so Flow 6 can’t import the component. It should be schlib add-json … --file /tmp/component_def.json (same issue appears in Flow 12 for pcblib add-json).
Useful? React with 👍 / 👎.
|
|
||
| # 2. Add footprint and generate dual-row pads (SOIC-8 style) | ||
| cargo run -p altium-cli -- pcblib add-footprint /tmp/test_flow10.PcbLib "SOIC-8" -d "8-pin SOIC" | ||
| cargo run -p altium-cli -- pcblib add-dual-row /tmp/test_flow10.PcbLib -f "SOIC-8" --pitch 50 --span 240 --start 1 -n 8 -w 25 --height 60 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update pcblib pad-row flags to match CLI
pcblib add-dual-row does not accept --span, --start, -w, or --height; the CLI expects --row-spacing plus --pad-width/--pad-height (or --pad-diameter/--hole) per PcbLibCommands::AddDualRow in crates/altium-cli/src/commands/pcblib.rs. As written, clap will exit with unknown-argument errors and Flow 10 won’t generate pads (the same flag mix-up appears in Flow 11).
Useful? React with 👍 / 👎.
| cargo run -p altium-cli -- pcbdoc add-net /tmp/test_flow23.PcbDoc "SIG1" | ||
|
|
||
| # 3. Place components | ||
| cargo run -p altium-cli -- pcbdoc place-component /tmp/test_flow23.PcbDoc "U1" 500 750 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use --at for pcbdoc place-component positions
PcbDocCommands::PlaceComponent (crates/altium-cli/src/commands/pcbdoc.rs) requires the position via --at x,y (or alternatives like --near, --edge); positional coordinates aren’t accepted. This line will be parsed as extra args and fail, preventing Flow 23 from placing components. Use --at 500,750 instead.
Useful? React with 👍 / 👎.
| # 4. Add track segment | ||
| cargo run -p altium-cli -- pcbdoc add-track /tmp/test_flow23.PcbDoc --start 500,750 --end 1000,750 -w 10 -l top -n "SIG1" | ||
|
|
||
| # 5. Add via |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix pcbdoc add-via flags and required layers
PcbDocCommands::AddVia expects --at (or --at-pad), --diameter, and mandatory --from-layer/--to-layer (crates/altium-cli/src/commands/pcbdoc.rs); it does not recognize --x, --y, or --size. As written, this step will error on unknown args/missing required flags and the via won’t be created in Flow 23.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds a comprehensive set of manual verification flows intended to exercise the majority of altium-cli functionality end-to-end via shell commands.
Changes:
- Introduces 30 self-contained manual verification flows spanning SchLib, PcbLib, SchDoc, PcbDoc, PrjPcb, query features, and cross-cutting CLI behavior.
- Defines expected “pass criteria” per flow and includes a category summary table for coverage tracking.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| cargo run -p altium-cli -- schlib add-pin /tmp/test_flow2.SchLib "LM7805" "1" "VIN" -50 0 -e input -o right | ||
| cargo run -p altium-cli -- schlib add-pin /tmp/test_flow2.SchLib "LM7805" "2" "GND" 0 -50 -e power -o up | ||
| cargo run -p altium-cli -- schlib add-pin /tmp/test_flow2.SchLib "LM7805" "3" "VOUT" 50 0 -e output -o left |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The schlib add-pin examples pass negative X/Y as positional args (e.g., -50). In the current CLI, x/y are positional strings without allow_hyphen_values, so values starting with - are parsed as flags and the command will fail. Rework these examples to avoid leading - positionals (or move coordinates after options and use -- to terminate option parsing).
| cargo run -p altium-cli -- schlib add-pin /tmp/test_flow2.SchLib "LM7805" "1" "VIN" -50 0 -e input -o right | |
| cargo run -p altium-cli -- schlib add-pin /tmp/test_flow2.SchLib "LM7805" "2" "GND" 0 -50 -e power -o up | |
| cargo run -p altium-cli -- schlib add-pin /tmp/test_flow2.SchLib "LM7805" "3" "VOUT" 50 0 -e output -o left | |
| cargo run -p altium-cli -- schlib add-pin /tmp/test_flow2.SchLib "LM7805" "1" "VIN" -e input -o right -- -50 0 | |
| cargo run -p altium-cli -- schlib add-pin /tmp/test_flow2.SchLib "LM7805" "2" "GND" -e power -o up -- 0 -50 | |
| cargo run -p altium-cli -- schlib add-pin /tmp/test_flow2.SchLib "LM7805" "3" "VOUT" -e output -o left -- 50 0 |
| cargo run -p altium-cli -- schlib add-rectangle /tmp/test_flow3.SchLib "IC1" -30 -40 30 40 --filled | ||
|
|
||
| # 3. Add a line | ||
| cargo run -p altium-cli -- schlib add-line /tmp/test_flow3.SchLib "IC1" -30 0 -40 0 |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These schlib add-rectangle/add-line examples also use negative positional coordinates (e.g., -30, -40). With the current CLI, those positionals will be interpreted as flags and the commands won’t parse. Please adjust the examples to avoid leading - positionals (or restructure to use -- after options).
| cargo run -p altium-cli -- schlib add-rectangle /tmp/test_flow3.SchLib "IC1" -30 -40 30 40 --filled | |
| # 3. Add a line | |
| cargo run -p altium-cli -- schlib add-line /tmp/test_flow3.SchLib "IC1" -30 0 -40 0 | |
| cargo run -p altium-cli -- schlib add-rectangle /tmp/test_flow3.SchLib "IC1" --filled -- -30 -40 30 40 | |
| # 3. Add a line | |
| cargo run -p altium-cli -- schlib add-line /tmp/test_flow3.SchLib "IC1" -- -30 0 -40 0 |
| ] | ||
| } | ||
| EOF | ||
| cargo run -p altium-cli -- pcblib add-json /tmp/test_flow12b.PcbLib /tmp/footprint_def.json |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pcblib add-json does not accept the JSON filepath as a positional argument. It requires --file/-f <path> (or --json/-j <string>), so this command will fail as written.
| cargo run -p altium-cli -- pcblib add-json /tmp/test_flow12b.PcbLib /tmp/footprint_def.json | |
| cargo run -p altium-cli -- pcblib add-json /tmp/test_flow12b.PcbLib --file /tmp/footprint_def.json |
| cargo run -p altium-cli -- pcbdoc place-component /tmp/test_flow23.PcbDoc "U1" 500 750 | ||
| cargo run -p altium-cli -- pcbdoc place-component /tmp/test_flow23.PcbDoc "R1" 1000 750 | ||
| cargo run -p altium-cli -- pcbdoc place-component /tmp/test_flow23.PcbDoc "C1" 1500 750 |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pcbdoc place-component takes an optional --at "x,y" (and other placement options); it does not take X and Y as positional arguments. These commands will fail as written.
| cargo run -p altium-cli -- pcbdoc place-component /tmp/test_flow23.PcbDoc "U1" 500 750 | |
| cargo run -p altium-cli -- pcbdoc place-component /tmp/test_flow23.PcbDoc "R1" 1000 750 | |
| cargo run -p altium-cli -- pcbdoc place-component /tmp/test_flow23.PcbDoc "C1" 1500 750 | |
| cargo run -p altium-cli -- pcbdoc place-component /tmp/test_flow23.PcbDoc "U1" --at "500,750" | |
| cargo run -p altium-cli -- pcbdoc place-component /tmp/test_flow23.PcbDoc "R1" --at "1000,750" | |
| cargo run -p altium-cli -- pcbdoc place-component /tmp/test_flow23.PcbDoc "C1" --at "1500,750" |
| # 2. Add several rules | ||
| cargo run -p altium-cli -- pcbdoc add-rule /tmp/test_flow25.PcbDoc clearance --value 6 | ||
| cargo run -p altium-cli -- pcbdoc add-rule /tmp/test_flow25.PcbDoc width --value 8 | ||
| cargo run -p altium-cli -- pcbdoc add-rule /tmp/test_flow25.PcbDoc via --value 20 | ||
|
|
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flow 25’s pcbdoc add-rule examples use the wrong argument shape (missing required rule name, and --value is not a supported flag). These commands won’t parse with the current CLI.
| cargo run -p altium-cli -- pcbdoc add-polygon /tmp/test_flow24.PcbDoc top "GND" "0,0 3000,0 3000,2000 0,2000" | ||
|
|
||
| # 5. Add text on silkscreen | ||
| cargo run -p altium-cli -- pcbdoc add-text /tmp/test_flow24.PcbDoc --text "REV A" --x 1500 --y 100 --layer top-overlay --height 50 |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pcbdoc add-text expects the text and position as positional args (text and at in "x,y" form) plus --layer/-l; it does not support --text/--x/--y. This command will fail as written.
| cargo run -p altium-cli -- pcbdoc add-text /tmp/test_flow24.PcbDoc --text "REV A" --x 1500 --y 100 --layer top-overlay --height 50 | |
| cargo run -p altium-cli -- pcbdoc add-text /tmp/test_flow24.PcbDoc "REV A" 1500,100 --layer top-overlay --height 50 |
|
|
||
| # 4. Add BGA-style grid pads | ||
| cargo run -p altium-cli -- pcblib add-footprint /tmp/test_flow10.PcbLib "BGA-16" -d "16-ball BGA" | ||
| cargo run -p altium-cli -- pcblib add-pad-grid /tmp/test_flow10.PcbLib -f "BGA-16" --pitch 50 --rows 4 --cols 4 -w 25 --height 25 |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pcblib add-pad-grid example uses flags that don't exist (-w, --height). The current CLI takes --pad-diameter (and optional --shape/--skip-center) for grid pads, so this command will fail as written.
| cargo run -p altium-cli -- pcblib add-pad-grid /tmp/test_flow10.PcbLib -f "BGA-16" --pitch 50 --rows 4 --cols 4 -w 25 --height 25 | |
| cargo run -p altium-cli -- pcblib add-pad-grid /tmp/test_flow10.PcbLib -f "BGA-16" --pitch 50 --rows 4 --cols 4 --pad-diameter 25 |
| cargo run -p altium-cli -- schlib gen-ic /tmp/test_flow14.SchLib "LM7805" --pins "VIN,GND,VOUT" | ||
| cargo run -p altium-cli -- schlib gen-ic /tmp/test_flow14.SchLib "RES" --pins "1,2" |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue as Flow 4: schlib gen-ic takes the pins string as a positional argument, and the pins must be in designator:name:type[:side],... format. Using --pins "VIN,GND,VOUT" will not parse and the abbreviated pin list format is invalid.
| cargo run -p altium-cli -- schlib gen-ic /tmp/test_flow14.SchLib "LM7805" --pins "VIN,GND,VOUT" | |
| cargo run -p altium-cli -- schlib gen-ic /tmp/test_flow14.SchLib "RES" --pins "1,2" | |
| cargo run -p altium-cli -- schlib gen-ic /tmp/test_flow14.SchLib "LM7805" "1:VIN:pwr:LEFT,2:GND:pwr:LEFT,3:VOUT:pwr:RIGHT" | |
| cargo run -p altium-cli -- schlib gen-ic /tmp/test_flow14.SchLib "RES" "1:1:passive:LEFT,2:2:passive:RIGHT" |
| ```bash | ||
| # 1. Setup: Create schematic with library and placed component | ||
| cargo run -p altium-cli -- schlib create /tmp/test_flow16.SchLib | ||
| cargo run -p altium-cli -- schlib gen-ic /tmp/test_flow16.SchLib "U1_IC" --pins "A,B,C,D" |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
schlib gen-ic here uses --pins and an abbreviated pins list, but the CLI expects a positional pins string in designator:name:type[:side],... format. As written, this command won’t parse.
| cargo run -p altium-cli -- schlib gen-ic /tmp/test_flow16.SchLib "U1_IC" --pins "A,B,C,D" | |
| cargo run -p altium-cli -- schlib gen-ic /tmp/test_flow16.SchLib "U1_IC" "1:A:io,2:B:io,3:C:io,4:D:io" |
| ```bash | ||
| # 1. Use the blank schematic as base, add content | ||
| cargo run -p altium-cli -- schlib create /tmp/test_flow20.SchLib | ||
| cargo run -p altium-cli -- schlib gen-ic /tmp/test_flow20.SchLib "OPAMP" --pins "V+,V-,OUT,VCC,VEE" |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
schlib gen-ic does not support --pins, and the pins string must be in designator:name:type[:side],... format. This invocation will fail as written.
| cargo run -p altium-cli -- schlib gen-ic /tmp/test_flow20.SchLib "OPAMP" --pins "V+,V-,OUT,VCC,VEE" | |
| cargo run -p altium-cli -- schlib gen-ic /tmp/test_flow20.SchLib "OPAMP" "1:V+:pwr:left,2:V-:pwr:left,3:OUT:io:right,4:VCC:pwr:top,5:VEE:pwr:bottom" |
Covers all major functionality areas: SchLib (6 flows), PcbLib (6 flows),
SchDoc editing and analysis (8 flows), PcbDoc board operations (5 flows),
PrjPcb project management (2 flows), query languages (2 flows), and
cross-cutting features like inspect, JSON output, and shell completions (1 flow).
https://claude.ai/code/session_01WwDHQFPm8vrsJoS2ptPmSf