Links
🏗

CodeMash CLI

CLI for CodeMash
You are here, so that means a lot to us. We track what's interesting for developers and CodeMash users, so we can prioritize our upcoming activities and bring you joy shortly. This topic is here because we are already working on this. Please check out the Roadmap and get more insights when it will be ready.
Currently, we are in the alpha phase. Please refer to the Roadmap "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.
#!/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 "***" \
​
# create a reusable template.
codemash notifications email templates new \
--project $PROJECT_ID \
--name "Company Newsletter" \
--from-file \
--body newsletter.html \
--subject "CodeMash Newsletter"
​
# create campaign and tomorrow send email to all employees
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 -
​