codex-plan
v0.1.4
Published
A small CLI that exposes the `codex-plan` command with `opencode` to open projects in VS Code.
Downloads
37
Maintainers
Readme
codex-plan
A tiny CLI that exposes the codex-plan command with a simple opencode subcommand to open a folder in Visual Studio Code.
Install (local testing)
- Clone or copy this repository to your machine.
- From the project root run:
npm install -g .You can now run:
codex-plan opencode [path]Examples:
# Open current directory in VS Code
codex-plan opencode
# Open a specific folder
codex-plan opencode ~/projects/my-repoIf path is omitted the current working directory is opened.
Install from npm (when published)
# Install globally
npm install -g codex-plan
# Or run without installing globally
npx codex-plan opencode [path]Install via OCX
If you or your users use OCX, OCX can install npm packages as components. After publishing to npm, OCX users can add this package directly from the npm registry:
# Install the package into the current project via OCX
ocx add npm:codex-plan
# Or install a specific published version
ocx add npm:[email protected]Notes:
ocx add npm:<pkg>installs the package into the project's.opencode/area as a component/plugin. If you want the global CLI available on the PATH, install vianpm install -g codex-planinstead.- After OCX installs the package you can still run the
codex-plancommand (if installed globally) or invoke it via npx. OCX is primarily useful when you want to include the functionality as a project-scoped OpenCode component.
Example: run the OCX-installed component in your project
After ocx add npm:codex-plan the package files are placed under your project's .opencode/ directory. You can invoke the CLI from the project in a couple of ways:
- Add a small npm script that calls the installed binary (adjust the path if OCX placed the package in a different subfolder):
// package.json
{
"scripts": {
"opencode": "node .opencode/codex-plan/bin/codex-plan.js opencode"
}
}Then run:
npm run opencode -- [path]- Or inspect
.opencode/to find the package directory and run the binary directly:
node .opencode/codex-plan/bin/codex-plan.js opencode ~/projects/my-repoNote: OCX's install layout may vary by registry and component. If you don't find the package under .opencode/codex-plan, list the .opencode/ contents to locate it and update the path accordingly.
Publishing (how I prepared the package)
- Ensure
package.jsonhas a unique package name. Ifcodex-planis already taken on npm you may want to use a scoped name like@your-username/codex-plan. - Login to npm:
npm login. - Publish a public package:
npm publish --access public(for scoped packages use--access public).
Creating the GitHub repository
- Create a new public repository on GitHub (e.g.
codex-plan). - Push this code and create a lightweight tag for releases:
git init
git add .
git commit -m "chore: initial codex-plan CLI"
git remote add origin [email protected]:YOUR_USERNAME/codex-plan.git
git branch -M main
git push -u origin mainNotes
- This CLI is intentionally small and uses the VS Code command-line tool
codeto open folders. If you need support for other editors or more subcommands I can extend it. - I did not create the remote repository or publish to npm because I need your credentials or explicit approval to push/publish.
If you want I can:
- Initialize a git repository here and create the initial commit (I will not push to GitHub without your confirmation).
- Create the repository on GitHub and push the code if you provide access (or if you authorize me to use your
ghauthentication on this machine). - Publish the package to npm if you provide npm credentials or want me to guide you through it.
Tell me which of the above you'd like me to do next.
