Docs / How-to guides
Edit a server in your editor
Open a server's repository in VS Code, Cursor or Zed with sokie dev running, and ship through git.
A server's files live in its repository, not in Sokie: a deploy is Sokie's shared runtime plus a bundle built from sokie.json, the spec and a Markdown file per tool. So you change a server in your own editor, try it with sokie dev, and let git take it to production. sokie edit sets that up in one command.
Before you start
- The server is linked to a GitHub repository, and you can read that repository with git.
- You're signed in:
sokie login. - Your editor's command is on your PATH:
codefor VS Code,cursorfor Cursor,zedfor Zed. In VS Code or Cursor, run Shell Command: Install 'code' command in PATH (or'cursor') from the command palette; in Zed, run zed: install cli. Any other editor works through$VISUALor$EDITOR.
Open the server
On the server's page, choose Edit locally in the header or on the Overview's Edit locally tile, or press L. Pick your editor and copy the command. The app remembers your pick. Or type it yourself:
$ sokie edit majestic-lobster-123 --editor cursor Cloning your-org/petstore into /Users/you/code/petstore… Opened it in Cursor. Starting sokie dev… ✓ Running Petstore: 19 tools, private (1154ms) Server http://127.0.0.1:8787/mcp Inspector http://127.0.0.1:8788 Watching for edits. Ctrl+C stops.
It does three things:
- Clones the repository, or uses your clone. If the folder you're in is already a clone of the linked repository, that's the one. Otherwise it clones into
./<name>, asgit clonewould, and says where. A second run from the same place finds that clone again. Pass--dir <path>for a clone you keep somewhere else, or an empty folder to clone into. It never clones into a folder that already holds something else. - Opens the folder in your editor. With
--editor vscode,cursororzedit uses that editor's command. Without--editor, or when the command isn't on your PATH, it uses$VISUALor$EDITOR. If none of those is set, it prints the folder's path so you can open it yourself. - Starts
sokie devin the server's folder. The real runtime on your machine, reloading on every save. In a monorepo, that's the path the link names. The inspector's address is printed rather than opened, since your editor just took the screen.
With no slug, sokie edit uses the server the folder you're in is linked to. Add --no-dev to open the editor and stop there.
Get changes to production
Commit on a branch and push it. A pull request into the default branch gets its own preview server, rebuilt on every push, so you can try the change before anyone else calls it. Merge it, and the default branch deploys to production. Deploys and previews has the details.
Secrets for sokie dev go in .sokie/dev.env, which must stay out of git. sokie edit adds .sokie/ to .gitignore if it isn't there already.
A server with no repository
A server deployed from your machine with sokie deploy and never linked has no repository to clone, and Sokie keeps no copy of its files to hand back. Go to the folder you deployed from, link it, and edit there:
$ sokie link your-org/petstore --server majestic-lobster-123