- Fixed:
ocpwith no arguments prints usage without an internal zshshifterror. - Fixed: profile names are validated for
ocp,ocp --set-default,ocp new,ocp-new,ocp copy, andocp-copy. - Fixed: profile create/copy operations return non-zero instead of printing success after write failures.
- Fixed: installer source lines are quoted and tested with install paths containing spaces.
- Fixed: installer
.zshrcedits are opt-in through--write-zshrc. - Fixed: pass-through argument behavior is tested without shell string evaluation for quoted arguments.
- Fixed:
ocp list,ocp current,ocp doctor,ocp new, andocp copyare implemented and documented. - Fixed: the README uses the public
jleifeld/opencode-profilesrepository URL.
src/ocp.zsh shifts before validating that a profile argument exists.
Current behavior:
ocp:shift:17: shift count must be <= $#
usage: ocp <profile> [opencode args...]
Expected behavior: show usage without an internal zsh error.
Recommended change:
- Add a Bats test for
ocpwith no arguments. - Check
(( $# == 0 ))before assigningprofileand callingshift.
Profile names are used directly as path segments in ocp, ocp-new, and ocp-copy.
Examples that should be rejected:
ocp-new ../outside
ocp ../../somewhere
ocp-copy work ../copyRecommended change:
- Add
_ocp_valid_profile_name. - Reject empty names,
.,.., names containing/, and names containing NUL-like unsafe input. - Add tests for rejected profile names in
ocp,ocp-new,ocp-copy, and--set-default.
ocp-copy prints success even if cp -R fails. ocp-new also assumes directory and file writes succeeded.
Recommended change:
- Use
command cp -R "$src_root" "$dst_root" || return 1. - Check
mkdirand config-file writes inocp-new. - Add tests for failed writes where feasible.
The installer writes this style of line to .zshrc:
source /path/to/opencode-profiles/src/ocp.zshThis breaks if the install path contains spaces.
Recommended change:
- Write a quoted zsh source line.
- Escape embedded double quotes and backslashes in the generated path.
- Add an installer test using an
OCP_INSTALL_DIRwith spaces.
For a public installer, automatically modifying .zshrc can surprise users.
Recommended change:
- Consider making the default installer copy files and print the source line.
- Add
--write-zshrcor--modify-zshrcfor automatic edits. - Keep
--dry-runfor previewing behavior.
The install docs still use:
git clone https://github.com/<owner>/opencode-profiles.gitRecommended change:
- Replace
<owner>once the GitHub repository owner is known.
The tests cover simple argument forwarding but not arguments containing spaces, quotes, or shell-sensitive characters.
Recommended change:
- Add tests for passing arguments like
"hello world"throughocp. - Avoid helper patterns that rely on shell string evaluation when testing argument preservation.
- The core idea is clear:
ocpruns OpenCode with a selected profile. ocp-new workis easy to understand as the first command.ocp workis short and convenient for daily use.ocp work --set-defaultmakes sense once the user understands that plainopencodeis wrapped.ocp --reset-defaultis discoverable and consistent with the default-profile feature.
- It is not obvious that this project works by sourcing a zsh file, not by installing a standalone executable.
- It is not immediately clear that
opencodeitself becomes a shell function wrapper after installation. ocp work --helpis ambiguous: users may expect help forocp, but it actually forwards--helpto OpenCode becauseworkis treated as the profile.ocp-newandocp-copyfeel like separate commands, while users may expect subcommands such asocp new workandocp copy work personal.- The README explains the profile layout but does not show where users should put agents, commands, and plugins after creating a profile.
- There is no command to list available profiles.
- There is no command to show the current default profile.
- There is no doctor/debug command to explain why a profile is invalid.
The most useful additions would be:
ocp list
ocp current
ocp doctor [profile]Benefits:
ocp listhelps users discover profile names.ocp currentshows which profile plainopencodewill use.ocp doctor workcan explain missing files instead of only saying the profile is invalid.
Current management commands:
ocp-new work
ocp-copy work personalAlternative:
ocp new work
ocp copy work personalThis makes the CLI feel more cohesive. The current command names can stay as aliases if backward compatibility matters after public release.
The help output should explain pass-through behavior:
usage:
ocp <profile> [-- <opencode args...>]
ocp <profile> --set-default
ocp --reset-default
ocp --help
Using -- as an optional separator would make this clearer:
ocp work -- --helpThat avoids confusion between ocp flags and OpenCode flags.
After ocp-new work, print next steps:
created isolated profile: work
path: ~/.config/opencode-profiles/work
Next steps:
ocp work
ocp work --set-default
This would make onboarding smoother.
Current error:
profile not found or missing OpenCode config: <path>
Better error:
profile is invalid: work
missing config file: opencode.jsonc or opencode.json
expected config dir: .opencode/
This reduces the need to inspect the README when something goes wrong.
The default profile feature is useful, but it is conceptually subtle because it changes plain opencode behavior.
README and help should state clearly:
ocp <profile>always runs one profile for one command.ocp <profile> --set-defaultchanges future plainopencodecalls.ocp --reset-defaultrestores plainopencodebehavior.
- Fix no-argument handling.
- Add profile-name validation.
- Make write operations fail safely.
- Add
ocp listandocp current. - Improve help text and README around pass-through args and the
opencodewrapper. - Decide whether to keep
ocp-newandocp-copyor move toocp newandocp copybefore the first public release.