Skip to content

amsdal

AMSDAL CLI - a tool that provides the ability to create a new app, generate models, transactions, build, serve, and other useful features for the efficient building of new apps using AMSDAL Framework.

Args: ctx (typer.Context): The Typer context object. version (bool, optional): If True, check and show versions of AMSDAL packages. Defaults to False.

Returns: None

Usage:

$ amsdal [OPTIONS] COMMAND [ARGS]...

Options:

  • -v, --version: Check and show versions of amsdal packages
  • --help: Show this message and exit.

Commands:

  • api-check: Run API tests against target URL and...
  • new, n: Generates a new AMSDAL application.
  • plugin: Generates a new AMSDAL plugin.
  • verify, vrf, v: Verifies all application's files such as...
  • build, bld, b: Builds the app and generates the models...
  • clean, cln: Cleans project's folder by removing all...
  • serve, srv, s: Starts a test FastAPI server based on your...
  • restore, rst: Restores either models or state database...
  • ci-cd: Generates CI/CD pipeline files for...
  • tests, test: Runs tests with the specified database...
  • register-connection, reg-conn: Registers and adds a new connection to the...
  • gen-token, gen_token, gt: Generates an authentication token from the...
  • generate, gen, g: Generates application's files such as...
  • cloud, cld: Commands to interact with the Cloud Server.
  • migrations, migs, mgs: Commands to manage migrations.
  • worker, w: Commands to run worker.

amsdal api-check

Run API tests against target URL and compare results with another endpoint or saved logs.

The command requires a configuration file (in YAML or JSON format) that defines: - Test cases with inputs and expected outputs - Authentication settings - Endpoints to test

Authentication can be configured using environment variables: - AMSDAL_API_CHECK_AUTHORIZATION: Authorization token - AMSDAL_API_CHECK_EMAIL: Email for authentication - AMSDAL_API_CHECK_PASSWORD: Password for authentication

If the token is invalid and no credentials are provided, the command will exit with an error.

Examples:

  1. Save logs to a file without comparison:

    amsdal api-check https://api.example.com --compare-url https://api.example.com --output logs.json
    
    This uses the same URL for both target and comparison, which skips the comparison but still runs the API checks and saves the logs.

  2. Compare a URL with previously saved logs:

    amsdal api-check https://api.example.com --compare-logs previous-logs.json
    
    This runs API checks against the target URL and compares the results with the logs stored in previous-logs.json.

  3. Compare two different URLs:

    amsdal api-check https://api-prod.example.com --compare-url https://api-staging.example.com
    
    This runs API checks against both URLs and compares the results.

You can combine these options as needed:

amsdal api-check https://api-prod.example.com --compare-url https://api-staging.example.com            --output comparison.json
This compares the two URLs and also saves the logs from the target URL.

Usage:

$ amsdal api-check [OPTIONS] TARGET_URL

Arguments:

  • TARGET_URL: Target API base URL to test [required]

Options:

  • -c, --config PATH: Path to configuration file (YAML or JSON) with test cases and auth settings [default: api-check-config.json]
  • --compare-url TEXT: Second API base URL to compare against
  • --compare-logs PATH: Path to existing logs file to compare against
  • -o, --output PATH: Path to save output logs
  • --help: Show this message and exit.

amsdal new, n

Generates a new AMSDAL application.

Example:

amsdal new MyApplication .

It will create my_application directory in the current directory with AMSDAL project.

Usage:

$ amsdal new, n [OPTIONS] APP_NAME OUTPUT_PATH

Arguments:

  • APP_NAME: The Application name. For example: MyApplication [required]
  • OUTPUT_PATH: Output path, where the app will be created. [required]

Options:

  • --models-format [json|py]: The format of models used in this app. [default: py]
  • --async: Whether to run the application in async mode.
  • --help: Show this message and exit.

amsdal plugin

Generates a new AMSDAL plugin.

Example:

amsdal plugin MyPlugin .

It will create my_plugin directory in the current directory with AMSDAL plugin structure.

Usage:

$ amsdal plugin [OPTIONS] PLUGIN_NAME OUTPUT_PATH

Arguments:

  • PLUGIN_NAME: The Plugin name. For example: MyPlugin [required]
  • OUTPUT_PATH: Output path, where the plugin will be created. [required]

Options:

  • --models-format [json|py]: The format of models used in this plugin. [default: py]
  • --async: Whether to run the plugin in async mode.
  • --help: Show this message and exit.

amsdal verify, vrf, v

Verifies all application's files such as models, properties, transactions, etc.

Usage:

$ amsdal verify, vrf, v [OPTIONS]

Options:

  • --building / --no-building: Do verify model building? [default: no-building]
  • --help: Show this message and exit.

amsdal build, bld, b

Builds the app and generates the models and other files.

Usage:

$ amsdal build, bld, b [OPTIONS] [OUTPUT]

Arguments:

  • [OUTPUT]: Path to output directory [default: .]

Options:

  • --config PATH: Path to custom config.yml file
  • --help: Show this message and exit.

amsdal clean, cln

Cleans project's folder by removing all generated files and optionally local database.

Example of usage:

  1. Cleanup generated files without removing local database:

    amsdal clean
    

  2. Cleanup generated files and remove local database:

    amsdal clean --remove-db
    

Usage:

$ amsdal clean, cln [OPTIONS] [OUTPUT]

Arguments:

  • [OUTPUT]: Path to output directory [default: .]

Options:

  • -db, --remove-db: Remove local database?
  • --help: Show this message and exit.

amsdal serve, srv, s

Starts a test FastAPI server based on your app's models.

Usage:

$ amsdal serve, srv, s [OPTIONS]

Options:

  • --cleanup / --no-cleanup: Cleanup the generated models, warehouse and files after stopping [default: cleanup]
  • --remove-warehouse-on-cleanup / --no-remove-warehouse-on-cleanup: Remove the warehouse directory on cleanup [default: no-remove-warehouse-on-cleanup]
  • --config PATH: Path to custom config.yml file
  • --host TEXT: Host to run the server on [default: 0.0.0.0]
  • --port INTEGER: Port to run the server on
  • --auto-reload / --no-auto-reload: Enable auto-reload of the server when files change [default: no-auto-reload]
  • --apply-fixtures / --no-apply-fixtures: Apply fixtures to the database [default: apply-fixtures]
  • --help: Show this message and exit.

amsdal restore, rst

Restores either models or state database from the lakehouse.

Example of usage:

  1. Restore models:

    amsdal restore models --config config.yml
    

  2. Restore state database:

    amsdal restore state_db --config config.yml
    

Usage:

$ amsdal restore, rst [OPTIONS]

Options:

  • --restore-type [models|state_db]: [default: models]
  • --config PATH: Path to custom config.yml file
  • --help: Show this message and exit.

amsdal ci-cd

Generates CI/CD pipeline files for specified VCS. Currently supported VCS are GitHub.

Example of usage:

Generate CI/CD pipeline files for GitHub:

amsdal ci-cd

Usage:

$ amsdal ci-cd [OPTIONS] [OUTPUT]

Arguments:

  • [OUTPUT]: Path to output directory [default: .]

Options:

  • --vcs [github]: Version Control System [default: github]
  • --help: Show this message and exit.

amsdal tests, test

Runs tests with the specified database execution type, state option, and lakehouse option.

Example usage:

  1. Run tests on SQLite database:

    amsdal tests
    

  2. Run tests on PostgreSQL database:

    amsdal tests --state-option postgres --lakehouse-option postgres
    

  3. Run tests with lakehouse-only execution type:

    amsdal tests --db-execution-type lakehouse_only
    

Usage:

$ amsdal tests, test [OPTIONS]

Options:

  • --db-execution-type [lakehouse_only|include_state_db]: [default: include_state_db]
  • --state-option [sqlite|postgres]: [default: sqlite]
  • --lakehouse-option [postgres|sqlite]: [default: sqlite]
  • --help: Show this message and exit.

amsdal register-connection, reg-conn

Registers and adds a new connection to the AMSDAL configuration.

Example of usage:

  1. Register a connection to a SQLite database:
    amsdal reg-conn sqlite -creds db_path=path/to/file/db.sqlite3
    
  2. Register a connection to a PostgreSQL database:

    amsdal reg-conn postgres -creds dsn='postgresql://user:password@localhost:5432/mydatabase' -creds schema=public
    

  3. Register a connection to a CSV file:

    amsdal reg-conn csv -creds db_path=src/csv_dir/ -meta pk="data.csv:column_name"
    

Register existing connection flow:

  1. First of all, make sure the core migrations are applied and you have initialized lakehouse and default state db using amsdal migrations apply
  2. Run amsdal reg-conn command to register a new connection, e.g. amsdal reg-conn sqlite -creds db_path=external_db.sqlite3
  3. The connection was added to your config. Data from external connection was synced with lakehouse. The models were generated.
  4. Now you need to generate migrations for the new models. Run amsdal migrations new to generate migrations for the new models.
  5. The last step is to apply the new migrations in fake mode. Run amsdal migrations apply --fake to apply the new migrations.

Usage:

$ amsdal register-connection, reg-conn [OPTIONS] DB_TYPE:{postgres|sqlite|csv}

Arguments:

  • DB_TYPE:{postgres|sqlite|csv}: [required]

Options:

  • -creds TEXT: Credentials for the connection in the format: prop="value". The prop=1.0 format is also supported and will be converted to a float. To get a boolean, use prop=true or prop=false. To get a Path use prop="path/to/file"::path. [required]
  • -meta TEXT: Metadata for the connection. Useful to specify primary keys, foreign keys, etc. The format is the next: pk="file_name.csv:column1,column2"
  • --connection-name TEXT: Name of the connection to be registered. If not provided, it will be generated.
  • --backend TEXT: Backend to use for the connection. If it's not provided, it will be resolved from db_type.
  • --config PATH: Path to custom config.yml file
  • --help: Show this message and exit.

amsdal gen-token, gen_token, gt

Generates an authentication token from the local AMSDAL API server.

Usage:

$ amsdal gen-token, gen_token, gt [OPTIONS]

Options:

  • -e, --email TEXT: Email for authentication.
  • -p, --password TEXT: Password for authentication.
  • --mfa-code TEXT: MFA code for two-factor authentication.
  • --help: Show this message and exit.

amsdal generate, gen, g

Generates application's files such as models, properties, transactions, etc.

Usage:

$ amsdal generate, gen, g [OPTIONS] COMMAND [ARGS]...

Options:

  • --help: Show this message and exit.

Commands:

  • external-models, ext-models, em: Generate ExternalModel classes from...
  • frontend_config, fconfig, fcfg, fc: Generates Frontend Config fixture file for...
  • hook, hk, h: Generates hook file for specified model.
  • model, mdl, md: Generates model file.
  • modifier, mod, mdf: Generates modifier file for specified model.
  • permission, p: Generates permission fixture file for...
  • property, prop, pr: Generates property file for specified model.
  • tests: Generates tests for the given model.
  • transaction, tr, t: Generates transaction file with specified...

amsdal generate, gen, g external-models, ext-models, em

Generate ExternalModel classes from external database connections.

This command introspects an external database connection and generates ExternalModel classes for the tables. The generated models can be used immediately to query the external database.

Examples:

Generate models for all tables in an external connection:

amsdal generate external-models my_external_db

Generate models for specific tables only:

amsdal generate external-models my_external_db -t users -t posts -t comments

Generate models in JSON format:

amsdal generate external-models my_external_db --format json

Specify custom output directory:

amsdal generate external-models my_external_db -o src/external_models

Generate models for a specific PostgreSQL schema:

amsdal generate external-models pg_db --schema public

Prerequisites:

  1. The external connection must be configured in your AMSDAL config
  2. The connection must support schema introspection (SQLite, PostgreSQL)
  3. The ExternalConnectionManager must be properly set up

Generated Output:

For Python format: - Creates a module for each model: models/external/{table_name}.py - Each module contains an ExternalModel class ready to use

For JSON format: - Creates JSON schema files: models/external/{table_name}/model.json - Can be loaded dynamically by AMSDAL framework

Usage:

$ amsdal generate, gen, g external-models, ext-models, em [OPTIONS] CONNECTION_NAME

Arguments:

  • CONNECTION_NAME: The name of the external connection configured in config [required]

Options:

  • -o, --output PATH: Output directory for generated models (defaults to models/external/)
  • -t, --table TEXT: Specific table names to generate models for (generates all if not specified)
  • -f, --format TEXT: Output format: "python" or "json" [default: python]
  • -s, --schema TEXT: Database schema name (for databases that support schemas like PostgreSQL)
  • --help: Show this message and exit.

amsdal generate, gen, g frontend_config, fconfig, fcfg, fc

Generates Frontend Config fixture file for the specified model.

Usage:

$ amsdal generate, gen, g frontend_config, fconfig, fcfg, fc [OPTIONS]

Options:

  • --model TEXT: The model name. It should be provided in PascalCase. [required]
  • --help: Show this message and exit.

amsdal generate, gen, g hook, hk, h

Generates hook file for specified model.

Usage:

$ amsdal generate, gen, g hook, hk, h [OPTIONS] HOOK_NAME:{pre_init|post_init|pre_create|post_create|pre_update|post_update|pre_delete|post_delete}

Arguments:

  • HOOK_NAME:{pre_init|post_init|pre_create|post_create|pre_update|post_update|pre_delete|post_delete}: The hook name. [required]

Options:

  • --model TEXT: The model name. It should be provided in PascalCase. [required]
  • --help: Show this message and exit.

amsdal generate, gen, g model, mdl, md

Generates model file.

Example of usage:

amsdal generate model UserProfile -attrs "name:string email:string:index age:number:default=18"

So the format of attribute definition is: <name>:<type>[:<options>]

Supported types:

  • string - Example: position:string
  • number - Example: age:number
  • boolean - Example: is_active:boolean
  • dict - Example: metadata:dict:string:Country (equivalent to metadata: dict in Python)
  • belongs-to - Example: user:belongs-to:User (equivalent to user: User in Python)
  • has-many - Example: posts:has-many:Post (equivalent to posts: list[Post] in Python)

Where "belongs-to" and "has-many" are used to define the relationship between models. The "belongs-to" type is used to define the relationship where the model has a reference to another model. The "has-many" type is used to define the relationship where the model has a list of references to another model.

The options are:

  • index - to mark the attribute as indexed. Example: email:string:index
  • unique - to mark the attribute as unique. Example: email:string:unique
  • required - to mark the attribute as required. Example: email:string:required
  • default - to set the default value for the attribute. It should be provided in the format: default=<value>. Example: age:number:default=18 name:string:default=Developer In order to put multi-word default values, you should use quotes. Example:
amsdal generate model Person -attrs "name:string:default='John Doe'"

Note, dict type does not support default value due to its complex structure.

The options can be combined. Examples: - email:string:unique:required - meta:dict:string:string:required:unique - age:number:default=18:required - name:string:default='John Doe':required

The ordering of the options does not matter.

Usage:

$ amsdal generate, gen, g model, mdl, md [OPTIONS] MODEL_NAME

Arguments:

  • MODEL_NAME: The model name. It should be provided in PascalCase. [required]

Options:

  • -attrs, --attributes TEXT: [default: None]
  • -u, --unique TEXT: [default: None]
  • --help: Show this message and exit.

amsdal generate, gen, g modifier, mod, mdf

Generates modifier file for specified model.

Usage:

$ amsdal generate, gen, g modifier, mod, mdf [OPTIONS] MODIFIER_NAME:{constructor|display_name|version_name}

Arguments:

  • MODIFIER_NAME:{constructor|display_name|version_name}: The modifier name. [required]

Options:

  • --model TEXT: The model name. It should be provided in PascalCase. [required]
  • --help: Show this message and exit.

amsdal generate, gen, g permission, p

Generates permission fixture file for specified model.

Usage:

$ amsdal generate, gen, g permission, p [OPTIONS]

Options:

  • --model TEXT: The model name. It should be provided in PascalCase. [required]
  • --create / --no-create: Generate 'create' permission. [default: create]
  • --read / --no-read: Generate 'read' permission. [default: read]
  • --update / --no-update: Generate 'update' permission. [default: update]
  • --delete / --no-delete: Generate 'delete' permission. [default: delete]
  • --help: Show this message and exit.

amsdal generate, gen, g property, prop, pr

Generates property file for specified model.

Usage:

$ amsdal generate, gen, g property, prop, pr [OPTIONS] PROPERTY_NAME

Arguments:

  • PROPERTY_NAME: The property name. Note, it will always transform the provided name to camel_case. Enter the name in camel_case in order to avoid any issues. [required]

Options:

  • --model TEXT: The model name. It should be provided in PascalCase. [required]
  • --help: Show this message and exit.

amsdal generate, gen, g tests

Generates tests for the given model.

Examples of usage:

  1. Generate unit tests for the model User:

    amsdal generate tests --model-name User
    

  2. Generate unit tests for the model User with random test data:

    amsdal generate tests --model-name User --test-data-type=random
    

  3. Generate unit tests for the model User with dummy test data:

    amsdal generate tests --model-name User --test-data-type=dummy
    

Usage:

$ amsdal generate, gen, g tests [OPTIONS]

Options:

  • --model-name TEXT: The model name. It should be provided in PascalCase. [required]
  • --test-type [unit]: The type of test to generate. [default: unit]
  • --test-data-type [random|dynamic|dummy]: The type of test data to generate. [default: dynamic]
  • -c, --config PATH
  • --seed INTEGER: The seed for the random number generator. [default: 0]
  • --help: Show this message and exit.

amsdal generate, gen, g transaction, tr, t

Generates transaction file with specified name.

Usage:

$ amsdal generate, gen, g transaction, tr, t [OPTIONS] TRANSACTION_NAME

Arguments:

  • TRANSACTION_NAME: The transaction name. Note, it will always transform the provided name to camel_case. Enter the name in camel_case in order to avoid any issues. [required]

Options:

  • --help: Show this message and exit.

amsdal cloud, cld

Commands to interact with the Cloud Server.

Usage:

$ amsdal cloud, cld [OPTIONS] COMMAND [ARGS]...

Options:

  • --help: Show this message and exit.

Commands:

  • expose-db, expose_db, edb: Adds your IP to the allowlist of the...
  • gen-token, gen_token, gt: Generates an authentication token from a...
  • get-monitoring-info, get_monitoring_info, gmi: Retrieves monitoring information for the...
  • sync-db, sync_db, sdb: Recreate local database from the remote one.
  • dependencies, deps: Manage dependencies for your Cloud Server...
  • deployments, deploys, ds: Manage app deployments on the Cloud Server.
  • environments, envs, env: Manage environments of your Cloud Server app.
  • external-connections, ext-conn, ec: Manage external connections for your Cloud...
  • secrets, sec, s: Manage secrets for your Cloud Server app.
  • security: Manage security of the Cloud Server app.

amsdal cloud, cld expose-db, expose_db, edb

Adds your IP to the allowlist of the database and returns the connection configs.

Usage:

$ amsdal cloud, cld expose-db, expose_db, edb [OPTIONS]

Options:

  • --env TEXT: Environment name. Default is the current environment from configuration.
  • --ip-address TEXT
  • --help: Show this message and exit.

amsdal cloud, cld gen-token, gen_token, gt

Generates an authentication token from a deployed AMSDAL API.

Usage:

$ amsdal cloud, cld gen-token, gen_token, gt [OPTIONS]

Options:

  • --env TEXT: Environment name. Default is the current environment from configuration.
  • -e, --email TEXT: Email for authentication.
  • -p, --password TEXT: Password for authentication.
  • --mfa-code TEXT: MFA code for two-factor authentication.
  • --help: Show this message and exit.

amsdal cloud, cld get-monitoring-info, get_monitoring_info, gmi

Retrieves monitoring information for the specified environment.

Usage:

$ amsdal cloud, cld get-monitoring-info, get_monitoring_info, gmi [OPTIONS]

Options:

  • --env TEXT: Environment name. Default is the current environment from configuration.
  • -o, --output [default|json|wide]: [default: default]
  • --help: Show this message and exit.

amsdal cloud, cld sync-db, sync_db, sdb

Recreate local database from the remote one.

Args: ctx (typer.Context): The Typer context object. env_name (typing.Annotated[typing.Optional, Option]): The name of the environment. Defaults to the current environment from configuration. db_type (DBType): The type of the database. Defaults to DBType.sqlite. skip_expose_db (bool): Whether to skip exposing the database. Defaults to False. skip_copy_data (bool): Whether to skip copying data. Defaults to False. skip_state_db (bool): Whether to skip syncing state db. Defaults to False. skip_lakehouse_db (bool): Whether to skip syncing lakehouse db. Defaults to False.

Returns: None

Usage:

$ amsdal cloud, cld sync-db, sync_db, sdb [OPTIONS]

Options:

  • --env TEXT: Environment name. Default is the current environment from configuration.
  • --db-type [postgres|sqlite|csv]: [default: sqlite]
  • -s: Skip exposing the database
  • -c: Skip copying data
  • -skip-state: Skip sync state db
  • -skip-lakehouse: Skip sync lakehouse db
  • --help: Show this message and exit.

amsdal cloud, cld dependencies, deps

Manage dependencies for your Cloud Server app. Without sub-command, it lists the dependencies.

Usage:

$ amsdal cloud, cld dependencies, deps [OPTIONS] COMMAND [ARGS]...

Options:

  • -o, --output [default|json|wide]: [default: default]
  • -a, --all: List all dependencies.
  • --sync: Sync the dependencies from the Cloud Server to ".dependencies".
  • --help: Show this message and exit.

Commands:

  • delete, del, d: Deletes dependency from your Cloud Server...
  • new, n: Creates a new dependency for your Cloud...

amsdal cloud, cld dependencies, deps delete, del, d

Deletes dependency from your Cloud Server app.

Usage:

$ amsdal cloud, cld dependencies, deps delete, del, d [OPTIONS] DEPENDENCY_NAME

Arguments:

  • DEPENDENCY_NAME: [required]

Options:

  • --env TEXT: Environment name. Default is the current environment from configuration.
  • --help: Show this message and exit.

amsdal cloud, cld dependencies, deps new, n

Creates a new dependency for your Cloud Server app.

Example usage:

amsdal cloud deps new libreoffice

Usage:

$ amsdal cloud, cld dependencies, deps new, n [OPTIONS] DEPENDENCY_NAME

Arguments:

  • DEPENDENCY_NAME: [required]

Options:

  • --env TEXT: Environment name. Default is the current environment from configuration.
  • --help: Show this message and exit.

amsdal cloud, cld deployments, deploys, ds

Manage app deployments on the Cloud Server. Without sub-command, it lists the deployments.

Usage:

$ amsdal cloud, cld deployments, deploys, ds [OPTIONS] COMMAND [ARGS]...

Options:

  • -o, --output [default|json|wide]: [default: default]
  • -a, --all
  • -c, --current-only: Show deployments only for current application
  • --help: Show this message and exit.

Commands:

  • delete, del, d: Destroys the app on the Cloud Server.
  • new, n: Deploys the app to the Cloud Server.

amsdal cloud, cld deployments, deploys, ds delete, del, d

Destroys the app on the Cloud Server.

Usage:

$ amsdal cloud, cld deployments, deploys, ds delete, del, d [OPTIONS] DEPLOYMENT_ID

Arguments:

  • DEPLOYMENT_ID: [required]

Options:

  • --help: Show this message and exit.

amsdal cloud, cld deployments, deploys, ds new, n

Deploys the app to the Cloud Server.

Usage:

$ amsdal cloud, cld deployments, deploys, ds new, n [OPTIONS]

Options:

  • --deploy-type [lakehouse_only|include_state_db]: [default: include_state_db]
  • --lakehouse-type [spark|postgres|postgres-immutable]: [default: postgres]
  • --env TEXT: Environment name. Default is the current environment from configuration.
  • --from-env TEXT: Environment name to copy from.
  • --no-input: Do not prompt for input.
  • --skip-checks: Skip checking secrets and dependencies before deploying.
  • --help: Show this message and exit.

amsdal cloud, cld environments, envs, env

Manage environments of your Cloud Server app. Without any sub-command, it will list all environments.

Usage:

$ amsdal cloud, cld environments, envs, env [OPTIONS] COMMAND [ARGS]...

Options:

  • -o, --output [default|json|wide]: [default: default]
  • --help: Show this message and exit.

Commands:

  • checkout, co: Changes the current environment to...
  • delete, del, d: Deletes an environment from the Cloud...
  • new, n: Adds a new environment to your Cloud...

amsdal cloud, cld environments, envs, env checkout, co

Changes the current environment to specified one.

Usage:

$ amsdal cloud, cld environments, envs, env checkout, co [OPTIONS] ENV_NAME

Arguments:

  • ENV_NAME: [required]

Options:

  • --help: Show this message and exit.

amsdal cloud, cld environments, envs, env delete, del, d

Deletes an environment from the Cloud Server app.

Usage:

$ amsdal cloud, cld environments, envs, env delete, del, d [OPTIONS] ENV_NAME

Arguments:

  • ENV_NAME: [required]

Options:

  • --help: Show this message and exit.

amsdal cloud, cld environments, envs, env new, n

Adds a new environment to your Cloud Server app.

Usage:

$ amsdal cloud, cld environments, envs, env new, n [OPTIONS] ENV_NAME

Arguments:

  • ENV_NAME: [required]

Options:

  • --help: Show this message and exit.

amsdal cloud, cld external-connections, ext-conn, ec

Manage external connections for your Cloud Server app. Without any sub-command, it will list all external connections.

Usage:

$ amsdal cloud, cld external-connections, ext-conn, ec [OPTIONS] COMMAND [ARGS]...

Options:

  • -o, --output [default|json|wide]: [default: default]
  • --env TEXT: Environment name. Default is the current environment from configuration.
  • --sync: Sync the external connections from the Cloud Server to ".external_connections".
  • --help: Show this message and exit.

Commands:

  • add, a: Adds a new external connection to your...
  • remove, rm, r: Removes an external connection from the...
  • update, u: Updates an existing external connection in...

amsdal cloud, cld external-connections, ext-conn, ec add, a

Adds a new external connection to your Cloud Server app.

Usage:

$ amsdal cloud, cld external-connections, ext-conn, ec add, a [OPTIONS] CONNECTION_NAME BACKEND

Arguments:

  • CONNECTION_NAME: [required]
  • BACKEND: [required]

Options:

  • -c, --credential TEXT: Credential in key=value format. Can be specified multiple times.
  • --env TEXT: Environment name. Default is the current environment from configuration.
  • --help: Show this message and exit.

amsdal cloud, cld external-connections, ext-conn, ec remove, rm, r

Removes an external connection from the Cloud Server app.

Usage:

$ amsdal cloud, cld external-connections, ext-conn, ec remove, rm, r [OPTIONS] CONNECTION_NAME

Arguments:

  • CONNECTION_NAME: [required]

Options:

  • --env TEXT: Environment name. Default is the current environment from configuration.
  • --help: Show this message and exit.

amsdal cloud, cld external-connections, ext-conn, ec update, u

Updates an existing external connection in your Cloud Server app.

Usage:

$ amsdal cloud, cld external-connections, ext-conn, ec update, u [OPTIONS] CONNECTION_NAME

Arguments:

  • CONNECTION_NAME: [required]

Options:

  • -b, --backend TEXT: New backend type for the connection.
  • -c, --credential TEXT: Credential in key=value format. Can be specified multiple times.
  • --env TEXT: Environment name. Default is the current environment from configuration.
  • --help: Show this message and exit.

amsdal cloud, cld secrets, sec, s

Manage secrets for your Cloud Server app. Without any sub-command, it will list all secrets.

Usage:

$ amsdal cloud, cld secrets, sec, s [OPTIONS] COMMAND [ARGS]...

Options:

  • -o, --output [default|json|wide]: [default: default]
  • --env TEXT: Environment name. Default is the current environment from configuration.
  • -v, --values: Show secret values
  • --sync: Sync the dependencies from the Cloud Server to ".secrets".
  • --help: Show this message and exit.

Commands:

  • delete, del, d: Deletes a secret from the Cloud Server app.
  • new, n: Adds a new secret to your Cloud Server app.

amsdal cloud, cld secrets, sec, s delete, del, d

Deletes a secret from the Cloud Server app.

Usage:

$ amsdal cloud, cld secrets, sec, s delete, del, d [OPTIONS] SECRET_NAME

Arguments:

  • SECRET_NAME: [required]

Options:

  • --env TEXT: Environment name. Default is the current environment from configuration.
  • --help: Show this message and exit.

amsdal cloud, cld secrets, sec, s new, n

Adds a new secret to your Cloud Server app.

Usage:

$ amsdal cloud, cld secrets, sec, s new, n [OPTIONS] SECRET_NAME SECRET_VALUE

Arguments:

  • SECRET_NAME: [required]
  • SECRET_VALUE: [required]

Options:

  • --env TEXT: Environment name. Default is the current environment from configuration.
  • --help: Show this message and exit.

amsdal cloud, cld security

Manage security of the Cloud Server app.

Usage:

$ amsdal cloud, cld security [OPTIONS] COMMAND [ARGS]...

Options:

  • --help: Show this message and exit.

Commands:

  • allowlist, alist, al: Control who can access the API
  • basic-auth, basic_auth, bauth, ba: Hide the API behind a Basic Auth

amsdal cloud, cld security allowlist, alist, al

Control who can access the API

Usage:

$ amsdal cloud, cld security allowlist, alist, al [OPTIONS] COMMAND [ARGS]...

Options:

  • --help: Show this message and exit.

Commands:

  • delete, del, d: Deletes your IP from the allowlist of the...
  • new, n: Adds your IP to the allowlist of the API.
amsdal cloud, cld security allowlist, alist, al delete, del, d

Deletes your IP from the allowlist of the API.

Examples of usage:

amsdal cloud security allowlist delete
amsdal cloud security allowlist delete --ip-address 0.0.0.0
amsdal cloud security allowlist delete --ip-address 0.0.0.0/24
amsdal cloud security allowlist delete --ip-address 0.0.0.0,1.0.0.0/24

Usage:

$ amsdal cloud, cld security allowlist, alist, al delete, del, d [OPTIONS]

Options:

  • --env TEXT: Environment name. Default is the current environment from configuration.
  • --ip-address TEXT: IP address, range or combination of both to delete from the allowlist. Will delete your IP if not provided.
  • --help: Show this message and exit.
amsdal cloud, cld security allowlist, alist, al new, n

Adds your IP to the allowlist of the API.

Examples of usage:

amsdal cloud security allowlist new
amsdal cloud security allowlist new --ip-address 0.0.0.0
amsdal cloud security allowlist new --ip-address 0.0.0.0/24
amsdal cloud security allowlist new --ip-address 0.0.0.0,1.0.0.0/24

Usage:

$ amsdal cloud, cld security allowlist, alist, al new, n [OPTIONS]

Options:

  • --env TEXT: Environment name. Default is the current environment from configuration.
  • --ip-address TEXT: IP address, range or combination of both to add to the allowlist. Will add your IP if not provided.
  • --help: Show this message and exit.

amsdal cloud, cld security basic-auth, basic_auth, bauth, ba

Hide the API behind a Basic Auth

Usage:

$ amsdal cloud, cld security basic-auth, basic_auth, bauth, ba [OPTIONS] COMMAND [ARGS]...

Options:

  • --help: Show this message and exit.

Commands:

  • delete, del, d: Deletes the Basic Auth for the application...
  • new, n: Adds a Basic Auth to the application API.
  • retrieve: Retrieves the Basic Auth credentials for...
amsdal cloud, cld security basic-auth, basic_auth, bauth, ba delete, del, d

Deletes the Basic Auth for the application API.

Usage:

$ amsdal cloud, cld security basic-auth, basic_auth, bauth, ba delete, del, d [OPTIONS]

Options:

  • --env TEXT: Environment name. Default is the current environment from configuration.
  • --help: Show this message and exit.
amsdal cloud, cld security basic-auth, basic_auth, bauth, ba new, n

Adds a Basic Auth to the application API.

Usage:

$ amsdal cloud, cld security basic-auth, basic_auth, bauth, ba new, n [OPTIONS]

Options:

  • --env TEXT: Environment name. Default is the current environment from configuration.
  • -u, --username TEXT: Username for the Basic Auth. If not provided, a random username will be generated.
  • -p, --password TEXT: Password for the Basic Auth. If not provided, a random password will be generated.
  • -o, --output [default|json|wide]: [default: default]
  • --help: Show this message and exit.
amsdal cloud, cld security basic-auth, basic_auth, bauth, ba retrieve

Retrieves the Basic Auth credentials for the application API.

Usage:

$ amsdal cloud, cld security basic-auth, basic_auth, bauth, ba retrieve [OPTIONS]

Options:

  • --env TEXT: Environment name. Default is the current environment from configuration.
  • -o, --output [default|json|wide]: [default: default]
  • --help: Show this message and exit.

amsdal migrations, migs, mgs

Commands to manage migrations. Without subcommand, it will show list of all migrations, which are applied and not applied including CORE and CONTRIB migrations.

Usage:

$ amsdal migrations, migs, mgs [OPTIONS] COMMAND [ARGS]...

Options:

  • -b, --build-dir PATH: [default: .]
  • -c, --config PATH
  • --help: Show this message and exit.

Commands:

  • apply, apl, ap: Applies migrations to the application.
  • new, n: Creates schema migration based on the...
  • new-contrib, nc: Creates schema migration based on the...

amsdal migrations, migs, mgs apply, apl, ap

Applies migrations to the application.

This command applies migrations in the following order:

  1. Core migrations
  2. Contrib migrations
  3. App migrations

Example of usage:

  1. Applies all pending migrations:

    amsdal migrations apply
    

  2. Applies all migrations up to a module type, e.g. CONTRIB:

    amsdal migrations apply --module contrib
    
    It will apply all core migrations + all contrib migrations

  3. Applies migrations up to a specific number:

    amsdal migrations apply --number 0002
    
    If you didn't specify the module type, it will apply migrations up to the specified number for the app module.

  4. Applies migrations in fake mode:

    amsdal migrations apply --fake
    
    It will apply all pending migrations in fake mode, so the actual changes will not be applied to the database.

Usage:

$ amsdal migrations, migs, mgs apply, apl, ap [OPTIONS]

Options:

  • -n, --number TEXT: Number of migration, e.g. 0002 or just 2. Use "zero" as a number to unapply all migrations including initial one.
  • -b, --build-dir PATH: [default: .]
  • -m, --module [type|core|user|contrib]: [default: user]
  • -f, --fake
  • -c, --config PATH
  • --help: Show this message and exit.

amsdal migrations, migs, mgs new, n

Creates schema migration based on the changes in the models' schemas or creates an empty data migration using --data flag.

Example usage:

  1. Automatically creates a schema migrations based on the changes in the models' schemas:

    amsdal migrations new
    

  2. Creates a schema migration with a custom name:

    amsdal migrations new --name my_custom_migration
    

  3. Creates a data migration:

    amsdal migrations new --data --name my_data_migration
    
    The data migrations allow you to write a python script to migrate your data. Useful for example when you have added a new column to the table and you want to populate it with some data. So you first generate a schema migration that adds the column and then you create a data migration that populates the column with the data.

Usage:

$ amsdal migrations, migs, mgs new, n [OPTIONS]

Options:

  • -b, --build-dir PATH: [default: .]
  • -n, --name TEXT: Migration name
  • -d, --data: Create data migration
  • -c, --config PATH
  • --help: Show this message and exit.

amsdal migrations, migs, mgs new-contrib, nc

Creates schema migration based on the changes in the contrib models' schemas or creates an empty data migration using --data flag.

Example usage:

  1. Automatically creates a schema migrations based on the changes in the contrib models' schemas:

    amsdal migrations new-contrib
    

  2. Creates a schema migration with a custom name:

    amsdal migrations new-contrib --name my_custom_contrib_migration
    

  3. Creates a data migration:

    amsdal migrations new-contrib --data --name my_contrib_data_migration
    
    The data migrations allow you to write a python script to migrate your data. Useful for example when you have added a new column to the table and you want to populate it with some data. So you first generate a schema migration that adds the column and then you create a data migration that populates the column with the data.

Usage:

$ amsdal migrations, migs, mgs new-contrib, nc [OPTIONS]

Options:

  • -b, --build-dir PATH: [default: .]
  • -n, --name TEXT: Migration name
  • -d, --data: Create data migration
  • -c, --config PATH
  • --help: Show this message and exit.

amsdal worker, w

Commands to run worker.

Usage:

$ amsdal worker, w [OPTIONS] COMMAND [ARGS]...

Options:

  • --help: Show this message and exit.

Commands:

  • run: Runs a worker for periodic tasks.

amsdal worker, w run

Runs a worker for periodic tasks.

Usage:

$ amsdal worker, w run [OPTIONS]

Options:

  • --mode [executor|scheduler|hybrid]: Worker mode. [default: executor]
  • --help: Show this message and exit.