Skip to content

Work from another directory

Run alis against a service or product without changing your shell's directory, and let the CLI fill in package IDs and references from where it runs.

Prerequisites

  • A product cloned under ~/alis.build/<org>/build/<product>/ (alis clone <org>.<product> --json does this).

Steps

  1. See what the CLI resolves from a directory:

    alis --cwd ~/alis.build/acme/build/shop/orders/v1 context view --json
    
    JSON
    {"organisation": "acme", "product": "shop", "packageId": "acme.shop.orders.v1", "serviceFolder": "…", "defineFolder": "…", "environments": [{"id": "<env-id>", "displayName": "Development", "production": false, "status": "ACTIVE", "projectId": "<project-id>"}]}
    

    --cwd is a global flag: it runs the command in that directory without a shell cd and without changing your parent shell. Coding-agent tools that cannot change directory use it on every call.

  2. Omit the package ID inside a service folder. These are equivalent:

    Shell
    alis build acme.shop.orders.v1 --json
    alis --cwd ~/alis.build/acme/build/shop/orders/v1 build --json
    
  3. Omit the leading parts of a dot reference inside a product folder. References fill right-aligned:

    Shell
    alis --cwd ~/alis.build/acme/build/shop product view --json          # acme.shop
    alis --cwd ~/alis.build/acme/build/shop environment refresh <env-id> --output .alis/.env   # acme.shop.<env-id>
    
  4. Pass the full reference when you are outside ~/alis.build:

    alis --cwd /tmp context view --json
    
    JSON
    {"notes": ["no local context — run inside ~/alis.build/<org>/build/<product> or pass <org>.<product>"]}
    
    Shell
    alis context view acme.shop --json
    alis build acme.shop.orders.v1 --json --branch main
    

How a package ID maps to folders

acme.shop.orders.v1 maps to the implementation folder ~/alis.build/acme/build/shop/orders/v1, the definitions folder ~/alis.build/acme/define/acme/shop/orders/v1, and the service id orders-v1. Multi-segment paths work the same way: acme.shop.internal.api.v2 is internal/api/v2.

Commits are detected too

define uses the latest pushed commit of the definitions repo; build uses the latest pushed commit that touched the service folder on the checked-out branch. Push first. In automation, pass --branch <branch> explicitly; a detached checkout must.

Inside a workstation

The CLI is locked to the workstation's organisation. A command for another organisation fails with exit 1 rather than resolving elsewhere; alis workstation open <org> opens that organisation's workstations instead.

Related: alis context, Organisations, products and services.