> For the complete documentation index, see [llms.txt](https://docs.codemash.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.codemash.io/cli/codemash-cli.md).

# CodeMash CLI

{% hint style="info" %}
This documentation is a work in progress, and we welcome your feedback and suggestions. Please let us know if you have any questions or if there is anything else you would like to see included in the documentation.
{% endhint %}

{% hint style="info" %}
This topic is here because we are already working on this. Please check out the [Roadmap](/roadmap.md) and get more insights when it is ready. &#x20;
{% endhint %}

Currently, we are in the **alpha** phase. Please refer to the [Roadmap](https://docs.codemash.io/roadmap#release-phases) "Release phases" section for more information.

You can use CodeMash CLI to create projects from templates, restore them from snapshots or use a powerful scripting language like bash to work with the modules.

```bash
#!/bin/bash
PROJECT_ID=$(codemash project new "My New Project" 2>&1)

# enabling database and importing data
codemash database enable --project $PROJECT_ID
cat employees.yaml | codemash database collection new --project $PROJECT_ID
cat employees.csv | codemash database import \
--collection "employees" \
--project $PROJECT_ID

# enabling email service
codemash notifications email enable --project $PROJECT_ID
codemash notifications email integrations new --project $PROJECT_ID \
--provider SendGrid \
--token "***" \
--email "no-reply@codemash.io"

# create a reusable template.
codemash notifications email templates new \
--project $PROJECT_ID \
--name "Company Newsletter" \
--from-file \
--body newsletter.html \
--subject "CodeMash Newsletter"

# create a campaign and send an email to all employees tomorrow
codemash database collections find --project $PROJECT_ID \ 
--projection '{ email: 1} ' | \
codemash notifications email campaigns new \
--project $PROJECT_ID \
--name "December Campaign" \
--template "Company Newsletter" \
--tokens '{ "campaignMonth": "December", "text": "Hi, this is newsletter"  }'
--postpone $(date --date='tomorrow' +%s) 
--recipients -

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.codemash.io/cli/codemash-cli.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
