Shakudo CLI (sctl)
Available on Shakudo version 3.37.0+
Starting in version 3.37.0, users can use the Shakudo CLI (sctl, pronounced "skuttle") within Sessions. sctl
is a command-line interface tool designed to help users create and manage Shakudo objects. The current version provides basic functionality, including listing immediate jobs and microservices, creating, restarting, and tailing logs of microservices. Users can perform operations on their own objects; the CLI only allows users to view and edit published objects or objects that they have created.
Features
- List workloads
- View workloads logs
- List microservices
- Create microservices
- Restart microservices
- View microservices logs
Manage Shakudo Objects
Immediate Jobs
Manage immediate jobs by listing or viewing their logs.
Commands:
sctl immediate-jobs ls --limit [number of items] --offset [offset of items]
: List all immediate jobs.sctl immediate-jobs logs --id [job-id] --lines [number of lines - defaults to 100]
: Tail logs of an existing immediate job by its ID.
Examples:
# List all immediate jobs
$ sctl immediate-jobs ls
# Tail logs for a specific immediate job
$ sctl immediate-jobs logs --id 12345
# Tail logs for a specific immediate job and set the line limit
$ sctl immediate-jobs logs --id 12345 --lines 1000
# Watch logs for a microservice every 2 seconds
watch sctl immediate-jobs logs --id 12345
Scheduled Jobs
View and manage scheduled jobs.
Commands:
sctl scheduled-jobs ls --limit [number of items] --offset [offset of items]
: List all scheduled jobs.
Examples:
# List all scheduled jobs
$ sctl scheduled-jobs ls
Microservices
Manage microservices by listing, creating, restarting, and viewing logs.
Commands:
sctl microservices ls --limit [number of items] --offset [offset of items]
: List all microservices.sctl microservices create [options]
: Create a new microservice.sctl microservices restart --id [service-id]
: Restart an existing microservice by ID.sctl microservices logs --id [service-id] --lines [number of lines - defaults to 100]
: Tail logs of a specific microservice by ID.
Examples:
Basic creation of a microservice:
$ sctl microservices create --gitServerName shakudo-dev-repo --ai
Creating a custom microservice with job name, subdomain, and script path:
$ sctl microservices create --scriptPath fastapi-openapi-example/run.sh \
--pipelineType BASH --jobName my-custom-ms --subdomain custom-subdomainCreating a microservice with notifications enabled:
$ sctl microservices create --gitServerName shakudo-dev-repo \
--notificationsEnabled \
--notificationTargetIds 8ebc86f3-c76e-4ce7-99f9-666151923b0c,14960534-15dd-4ffd-8d46-2e00b2f55f36 \
--healthCheckThreshold 5 --serviceAlertCooldownPeriod 7000 \
--scriptPath fastapi-openapi-example/run.sh --pipelineType BASHCreating a microservice with autoscaling:
$ sctl microservices create --gitServerName shakudo-dev-repo \
--minReplicas 2 --maxHpaRange 5Combining multiple flags for advanced microservice creation:
$ sctl microservices create \
--gitServerName shakudo-dev-repo \
--jobName test-service-example-cli \
--jobType basic-system \
--scriptPath fastapi-openapi-example/run.sh \
--pipelineType BASH \
--subdomain test-subdomain \
--notificationsEnabled \
--notificationTargetIds 8ebc86f3-c76e-4ce7-99f9-666151923b0c,14960534-15dd-4ffd-8d46-2e00b2f55f36 \
--healthCheckThreshold 2 --serviceAlertCooldownPeriod 2000 \
--minReplicas 1 --maxHpaRange 3 \
--port 8888 \
--billingProjectName prod-bp \
--serviceAccountName admin-sa \
--parameter ENV1=VAL1 --parameter ENV2=VAL2 \
--customSecretNames testing,pass-openai \
--readme "> this is a testing readme\n\n### this is a header\n"Watch logs of a microservice
# Watch logs for a microservice every 2 seconds
watch sctl microservices logs --id 12345
General Usage
$ sctl [COMMAND]
Use the help
command for detailed information about a specific topic or command.
Examples:
# Display help for the microservices topic
$ sctl microservices --help
# Display help for the immediate-jobs topic
$ sctl immediate-jobs --help
Version
The current version of the Shakudo CLI is 0.0.1
.
shakudo-cli/0.0.1 darwin-arm64 node-v18.18.0
Additional Notes
- Ensure that the appropriate flags and parameters are provided when creating or managing microservices.
- Invalid inputs, such as incorrect
pipelineType
, will throw an error.
This documentation provides an overview of the Shakudo CLI’s primary functionality, command usage, and examples to help users manage Shakudo deployments effectively.