Skip to content

dagger call is tedious with too many flags+args #6723

Closed

Description

@sipsma

Somewhat related to #6112 but a bit more general

Passing a large number of flags and args when using dagger call can become way too tedious to type out by hand. One example would be support for filtering dirs as mentioned here. But really any time a function accepts more than a few flags and/or the arguments to the flag end up being verbose are a problem.

This leaves users reaching for wrappers like shell scripts/makefiles/etc. While that's not the end of the world (i.e. we aren't going to actively try to prevent that from being possible), it's not great that users have to layer more abstractions on top of dagger to use it in relatively simple situations.

A few ideas have come up to potentially solve this:

  1. defaultArgs specified in dagger.json as described here
    • Basically, module constructors can have default args encoded in dagger.json and those args have the same features as the syntax in dagger call (e.g. local files/dirs specified by path, etc.)
  2. Support for "recording+saving" dagger call invocations and then being able to run them by name. As a strawman for the sake of a concrete example:
    • dagger call --save-as=my-build -m mydep build --dir '/some/path,**/*.go,!testdata' --some-arg false --token env:MY_TOKEN
    • After the above, you can now run dagger call my-build
  3. Support for Dagger Scripts (Dagger Scripts: a more convenient way to call Dagger Functions from your project #5774), possibly with an addition to support running scripts written to a file rather than inline.

These aren't mutually exclusive either. I think 2. might be my preferred starting place at the moment for the sake of being both general+relatively straightforward to implement, but all are pretty tempting and viable.

Activity

  1. added this to the v0.10.x milestone on Feb 23, 2024
  2. shykes commented on Mar 25, 2024

    @shykes
    Contributor

    @sipsma FYI I am reviving and refreshing #5774. It is my favorite candidate for solving this issue, I will flesh out my argument and try to build momentum. I think you're right that it's related to #5774, maybe we can kill 2 birds with one stone.

    I think we should merge this issue and #6112. The conversation is getting pretty fragmented. WDYT? I'm also going to close #5728.

  3. sipsma commented on Mar 25, 2024

    @sipsma
    ContributorAuthor

    @sipsma FYI I am reviving and refreshing #5774. It is my favorite candidate for solving this issue, I will flesh out my argument and try to build momentum. I think you're right that it's related to #5774, maybe we can kill 2 birds with one stone.

    I think we should merge this issue and #6112. The conversation is getting pretty fragmented. WDYT? I'm also going to close #5728.

    Yes that all SGTM. I'll also mention that my most recent ideas on how to approach #5993 (comment) would also end up being a solution to this problem. Basically, you could write code that executes directly on the host, is able to call out to module dependencies, but is also invokable without relying on toolchains being installed on the host (go, python, etc.).

  4. added
    area/cli
    and removed on Apr 10, 2024
  5. removed
    area/cli
    on May 31, 2024
  6. added
    area/cli
    on Jul 29, 2024
  7. nipuna-perera commented on Apr 25, 2025

    @nipuna-perera
    Contributor

    Bumping this. https://discord.com/channels/707636530424053791/1365319889279127645/1365397691835875359

    I'm finding myself passing GITHUB_TOKEN, USERNAME, PASSWORD, SONAR_TOKEN, JENKINS_API_TOKEN, ARTIFACTORY_TOKEN etc, etc. The commands get pretty long.

  8. shykes commented on Apr 30, 2025

    @shykes
    Contributor

    Also related: #9584

  9. nipuna-perera commented on Aug 5, 2025

    @nipuna-perera
    Contributor

    This is the most recent/relevant discussion on this - #10401

  10. shykes commented on Oct 1, 2025

    @shykes
    Contributor

    We're getting close to finally solving this: #11034

  11. locked and limited conversation to collaborators on Mar 24, 2026
  12. converted this issue into a discussion #12431 on Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cli

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions