Skip to content

consistently use positional identifiers#62

Merged
notnmeyer merged 3 commits intomainfrom
positional-identifiers
Apr 27, 2026
Merged

consistently use positional identifiers#62
notnmeyer merged 3 commits intomainfrom
positional-identifiers

Conversation

@notnmeyer
Copy link
Copy Markdown
Member

@notnmeyer notnmeyer commented Apr 27, 2026

there was a little inconsistency brewing where some commands would use flags for identifiers (events send --event <id>), and some commands would use positional identifiers (campaigns update <id>). this brings various commands in alignment with a general rule:

commands that interact with specific resources provide the identifier as the first positional arg. if a command supports multiple identifiers, use flags. everything else uses flags.

for example, that means campaigns update <id> uses a positional arg but campaigns create --name "my campaign" uses a flag. something like contacts find still has both --id and --email flags because they're mutually exclusive and both are used as identifiers.

the pr updates the following commands:

  • auth login --name <name> -> auth login <name>
  • auth logout --name <name> -> auth logout <name>
  • events send --event <name> -> events send <name>
  • transactional send --id <id> -> transactional send <id>
  • send --id <id> -> send <id>
➜ task -- auth login -h

  Authenticate with your Loops API key

  USAGE


    loops auth login <name> [--flags]


  FLAGS

    --debug        Print API request details before sending
    -h --help      Help for login
    -o --output    Output format (text, json) (text)
    --skip-verify  Save the API key without verifying it
    -t --team      Team key name to use
➜ task -- events send -h

  Send an event

  USAGE


    loops events send <event> [--flags]


  FLAGS

    --contact-props    Path to a JSON file of contact properties
    --debug            Print API request details before sending
    --email            Contact email address
    -h --help          Help for send
    --idempotency-key  Idempotency key to prevent duplicate sends
    --list             Mailing list subscription as id=true|false (repeatable)
    -o --output        Output format (text, json) (text)
    --props            Path to a JSON file of event properties
    -t --team          Team key name to use
    --user-id          Contact user ID
➜ task -- send -h
  Send a transactional email

  USAGE


    loops send <id> [--flags]


  FLAGS

    -a --add-to-audience  Create a contact if one doesn't exist
    -A --attachment       Path to a file to attach (repeatable)
    --debug               Print API request details before sending
    --email               Recipient email address
    -h --help             Help for send
    --idempotency-key     Idempotency key to prevent duplicate sends
    -j --json-vars        Path to a JSON file of data variables
    -o --output           Output format (text, json) (text)
    -t --team             Team key name to use
    -v --var              Data variable as KEY=value (repeatable)

@notnmeyer notnmeyer self-assigned this Apr 27, 2026
@notnmeyer notnmeyer requested a review from nalanj April 27, 2026 18:54
@notnmeyer notnmeyer merged commit 5a7a6b9 into main Apr 27, 2026
2 checks passed
@notnmeyer notnmeyer deleted the positional-identifiers branch April 27, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants