Using a coding agent?
- Paste prompt
- Skill
- Claude Code plugin
Paste this prompt into your agent. No install needed.
1. Install Bun
Already have Bun 1.4.2 or later? Skip to step 2. Check withbun --version.
Otherwise, install Bun:
bun is on your PATH.
2. Create the actor project
Install the Terse CLI:3. Let’s Look at the Actor
Terse init defaults to giving you a little counter actor. You should already have the following undercounter/actor/src/actor.ts.
src/actor.ts
4. Launch the Dev Server
Start the actor serve. Make sure you are in the root of you actor project (where the package.json is)!5. A little CLI to interact with the Actor
You can plop the generated client into a web app, CLI, serverless function etc… very easily. Open a second terminal, and go to your client folder incounter/client. Generate the backend client from here:
6. Try the counter!
Incounter/client, run:
7. Deploy to Terse
From the actor project:Test the deployed actor locally
Add these values tocounter/client/.env. Use the URL from terse deploy and your Terse API token:
counter/client:
8. That’s it!
You know have a globally accessible Actor that anyone in the world can access. Create an many counters as your hearts desire!Next steps
More examples
Browse AI chat, chatroom, collaborative documents, and more in the open source durable-actors project.
TypeScript guide
Learn fields, WebSockets, alarms, SQLite, and resources step by step.

