Skip to main content

Cosmo New

If you want to create your own actor implementations, the new command will help you to create a new actor from a template. This may be a completely new business logic or your own implementation of the offered actors. Here are the templates currently offered:

hello: a hello-world actor (in Rust) that responds over an HTTP connection

echo-tinygo: a hello-world actor (in TinyGo) that responds over an HTTP connection

echo-messaging: a hello-world actor (in Rust) that echoes a request back over a NATS connection

kvcounter: an example actor (in Rust) that increments a counter in a key-value store


cosmo new actor


--git GitHub repository url. Requires git to be installed

--output (Alias -o) Specify output format (text or json) [default: text]

--subfolder Optional sub-folder of the git repository

--branch Optional git branch. Defaults to "main"

--path (Alias -p) Optional path for template project (alternative to --git)

--values (Alias -v) Optional path to file containing placeholder values

--silent Silent - do not prompt user. Placeholder values in the templates will be resolved from a --values file and placeholder defaults

--favorites Favorites file - to use for project selection

--template-name (Alias -t) Template name - name of template to use

--no-git-init Don't run git init on the new folder