tuistSpec top-level property

FigSpec tuistSpec
final

Completion spec for tuist CLI

Implementation

final FigSpec tuistSpec = FigSpec(
  name: 'tuist',
  description: 'Generate, build and test your Xcode projects. For more info please see https://docs.tuist.io/',
  subcommands: [

    Subcommand(
      name: 'build',
      description: 'Build the project in the current directory',
      args: [
        Arg(
        name: 'scheme',
        description: 'The scheme to be built. By default it builds all the buildable schemes of the project in the current directory'
      )
      ],
      options: [

        Option(
          name: '--build-output-path',
          description: 'Build the project to a custom directory, example usage: \'tuist build --build-output-path .build\':'
        ),
        Option(
          name: '--device',
          description: 'Build the project to a specific device, example usage: \'tuist build --device "iPhone X"\':'
        ),
        Option(
          name: '--os',
          description: 'Build the project to a specific OS, example usage: \'tuist build --os 14.0\':'
        )
      ]
    ),
    Subcommand(
      name: 'cache',
      description: 'A set of utilities related to the caching of targets. For more info see https://docs.tuist.io/building-at-scale/caching USAGE: tuist cache <subcommand>',
      subcommands: [

        Subcommand(
          name: 'warm',
          description: 'Warms the local and remote cache',
          options: [

            Option(
              name: ['--path', '-p'],
              description: 'The path to the directory that contains the project whose targets will be cached'
            ),
            Option(
              name: ['--profile', '-P'],
              description: 'The name of the profile to be used when warming up the cache'
            ),
            Option(
              name: ['--xcframeworks', '-x'],
              description: 'When passed it caches the targets for simulator and device using xcframeworks'
            ),
            Option(
              name: '--dependencies-only',
              description: 'If passed, the command doesn\'t cache the targets passed in the `--targets` argument, but only their dependencies'
            )
          ]
        ),
        Subcommand(
          name: 'print-hashes',
          description: 'Print the hashes of the cacheable frameworks in the given project',
          options: [

            Option(
              name: ['--path', '-p'],
              description: 'The path to the directory that contains the project whose targets will be cached'
            ),
            Option(
              name: ['--profile', '-P'],
              description: 'The name of the profile to be used when warming up the cache'
            ),
            Option(
              name: ['--xcframeworks', '-x'],
              description: 'When passed it caches the targets for simulator and device using xcframeworks'
            )
          ]
        )
      ]
    ),
    Subcommand(
      name: 'clean',
      args: [
        Arg(
        name: 'clean-categories',
        description: 'The cache and artifact categories to be cleaned. If no category is specified, everything is cleaned. (default: plugins, builds, tests, generatedAutomationProjects, projectDescriptionHelpers, manifests, dependencies)'
      )
      ],
      description: 'Clean all the data generated by Tuist. USAGE: tuist clean [<clean-categories> ...] [--path <path>]',
      options: [

        Option(
          name: ['--path', '-p'],
          description: 'The path to the directory that contains the project that should be cleaned'
        ),
        Option(
          name: 'plugins',
          description: 'Clean only the plugins cache generated by Tuist, example usage: \'tuist clean plugins\':'
        ),
        Option(
          name: 'builds',
          description: 'Clean only the builds artifacts cache generated by Tuist, example usage: \'tuist clean builds\':'
        ),
        Option(
          name: 'tests',
          description: 'Clean only the tests cache generated by Tuist, example usage: \'tuist clean tests\':'
        ),
        Option(
          name: 'generatedAutomationProjects',
          description: 'Clean only the automation projects cache generated by Tuist, example usage: \'tuist clean generatedAutomationProjects\':'
        ),
        Option(
          name: 'projectDescriptionHelpers',
          description: 'Clean only the project description helpers cache generated by Tuist, example usage: \'tuist clean projectDescriptionHelpers\':'
        ),
        Option(
          name: 'manifests',
          description: 'Clean only the manifests cache generated by Tuist, example usage: \'tuist clean manifests\':'
        )
      ]
    ),
    Subcommand(
      name: 'fetch',
      description: 'Dependencies can be fetched by running the following command. They are stored in your project\'s `Tuist/Dependencies` directory. For more info see https://docs.tuist.io/commands/dependencies',
      options: [

        Option(
          name: ['--path', '-p'],
          description: 'The path to the directory that contains the workspace or project whose dependencies will be fetched/updated. The default is the current directory'
        ),
        Option(
          name: '--update',
          description: 'Clean only the builds artifacts cache generated by Tuist, example usage: \'tuist fetch --update\':'
        )
      ]
    ),
    Subcommand(
      name: 'edit',
      description: 'Editing your projects is easy; position yourself in a directory where there\'s a project defined and run the edit command. It will open a temporary Xcode project with all the project manifests and the project description helpers, so you will be able to edit the whole project configuration. After making changes you can run the target from Xcode and it will call tuist generate for you. For more info see https://docs.tuist.io/commands/edit',
      options: [

        Option(
          name: '--permanent',
          description: 'The project is deleted automatically once you are done with editing. If you wish to generate and keep the project in the current directory, you can run the command passing the --permanent argument. That will generate a Manifest.xcodeproj project that you can open manually'
        )
      ]
    ),
    Subcommand(
      name: 'graph',
      description: 'Generates a graph from the workspace or project in the current directory. For more info see https://docs.tuist.io/commands/graph USAGE: tuist graph [--skip-test-targets] [--skip-external-dependencies] [--format <format>] [--algorithm <algorithm>] [<targets> ...] [--path <path>] [--output-path <output-path>]',
      args: [
        Arg(
        name: 'targets',
        description: 'A list of targets to filter. Those and their dependent targets will be showed in the graph'
      )
      ],
      options: [

        Option(
          name: ['--skip-test-targets', '-t'],
          description: 'Excludes test targets from the generated graph'
        ),
        Option(
          name: ['--skip-external-dependencies', '-d'],
          description: 'Excludes external dependencies from the generated graph'
        ),
        Option(
          name: ['--format', '-f'],
          description: 'If you prefer to have the dot or json representations of the graph and render it separately. Available formats: dot, png, json (default: png)',
          args: [
            Arg(
            name: 'format',
            suggestions: [

              FigSuggestion(name: 'dot'),
              FigSuggestion(name: 'png'),
              FigSuggestion(name: 'json')
            ],
            defaultValue: 'png'
          )
          ]
        ),
        Option(
          name: ['--algorithm', '-a'],
          description: 'Available formats: dot, neato, twopi, circo, fdp, sfddp, patchwork (default: dot)',
          args: [
            Arg(
            name: 'format',
            suggestions: [

              FigSuggestion(name: 'dot'),
              FigSuggestion(name: 'neato'),
              FigSuggestion(name: 'twopi'),
              FigSuggestion(name: 'circo'),
              FigSuggestion(name: 'fdp'),
              FigSuggestion(name: 'sfddp'),
              FigSuggestion(name: 'patchwork')
            ],
            defaultValue: 'dot'
          )
          ]
        ),
        Option(
          name: ['--path', '-p'],
          description: 'The path to the directory that contains the definition of the project. Default is current directory',
          args: [
            Arg(
            name: 'project dir',
            template: 'folders'
          )
          ]
        ),
        Option(
          name: ['--output-path', '-o'],
          description: 'The path to where the image will be exported. When not specified, it exports the image in the current directory',
          args: [
            Arg(
            name: 'output path',
            template: 'folders'
          )
          ]
        ),
        Option(
          name: ['--no-open', '-n'],
          description: 'If set, the generated graph is not opened automatically. Default is yes'
        ),
        Option(
          name: ['--platform', '-l'],
          description: 'If set, show only the targets for the given platform. Default is all platforms. Available platforms: ios, macos, tvos, watchos',
          args: [
            Arg(
            name: 'platform',
            suggestions: [

              FigSuggestion(name: 'ios'),
              FigSuggestion(name: 'macos'),
              FigSuggestion(name: 'tvos'),
              FigSuggestion(name: 'watchos')
            ]
          )
          ]
        )
      ]
    ),
    Subcommand(
      name: 'generate',
      description: 'Generates an Xcode workspace to start working on the project. For more info see https://docs.tuist.io/commands/generate',
      args: [
        Arg(
        name: 'sources',
        description: 'A list of targets to focus on. Other targets will be linked as binaries if possible. If no target is specified, all the project targets will be generated (except external ones, such as Swift packages)'
      )
      ],
      options: [

        Option(
          name: ['--path', '-p'],
          description: 'The path to the directory that contains the definition of the project. Default is current directory',
          args: [
            Arg(
            name: 'path',
            template: 'folders'
          )
          ]
        ),
        Option(
          name: ['--no-open', '-n'],
          description: 'Don\'t open the project after generating it. Default is false'
        ),
        Option(
          name: ['--xcframeworks', '-x'],
          description: 'When passed it uses xcframeworks (simulator and device) from the cache instead of frameworks (only simulator). Default is false'
        ),
        Option(
          name: '--no-cache',
          description: 'Ignore cached targets, and use their sources instead.\tDefault is false'
        ),
        Option(
          name: ['--profile', '-P'],
          description: 'The name of the cache profile',
          args: [
            Arg(
            name: 'cache profile'
          )
          ]
        )
      ]
    ),
    Subcommand(
      name: 'migration',
      description: 'To help developers with the process of adopting Tuist, Tuist provides a set of commands under tuist migration. For more info see https://docs.tuist.io/commands/migration',
      subcommands: [

        Subcommand(
          name: 'settings-to-xcconfig',
          description: 'It\'s recommended to make .xcconfig files the source of truth for build settings. For that, Tuist provides a tuist migration settings-to-xcconfig command that extracts the build settings from targets and projects',
          options: [

            Option(
              name: ['--xcodeproj-path', '-p'],
              description: 'Required. Path to the Xcode project whose build settings will be extracted',
              args: [
                Arg(
                name: 'path',
                template: 'folders'
              )
              ]
            ),
            Option(
              name: ['--xcconfig-path', '-x'],
              description: 'Required. Path to the Xcode project whose build settings will be extracted',
              args: [
                Arg(
                name: 'path',
                template: 'folders'
              )
              ]
            ),
            Option(
              name: ['--target', '-t'],
              description: 'Optional. The name of the target whose build settings will be extracted. When not passed, it extracts the build settings of the project',
              args: [
                Arg(
                name: 'target'
              )
              ]
            )
          ]
        ),
        Subcommand(
          name: 'check-empty-settings',
          description: 'After making .xcconfig files the source of truth for build settings, it\'s important to ensure that build settings are no longer set to the project. To help with that, Tuist includes a command that fails if the build settings of a project or a target are not empty',
          options: [

            Option(
              name: ['--xcodeproj-path', '-p'],
              description: 'Required. Path to the Xcode project whose build settings will be checked'
            ),
            Option(
              name: ['--target', '-t'],
              description: 'Optional. The name of the target whose build settings will be checked. When not passed, it checks the build settings of the project'
            )
          ]
        ),
        Subcommand(
          name: 'list-targets',
          description: 'When passed it uses xcframeworks (simulator and device) from the cache instead of frameworks (only simulator). Default is false',
          options: [

            Option(
              name: ['--xcodeproj-path', '-p'],
              description: 'Required. Path to the Xcode project whose build settings will be checked'
            )
          ]
        )
      ]
    ),
    Subcommand(
      name: 'scaffold',
      description: 'Generates new project based on a template. For more info see https://docs.tuist.io/commands/scaffold USAGE: tuist scaffold <template> [--json] [--path <path>] <subcommand>',
      args: [
        Arg(
        name: 'template',
        description: 'Name of template you want to use'
      )
      ],
      subcommands: [

        Subcommand(
          name: 'list',
          description: 'Lists available scaffold templates'
        )
      ],
      options: [

        Option(
          name: ['--path', '-p'],
          description: 'The path to the folder where the template will be generated (Default: Current directory)',
          args: [
            Arg(
            name: 'path'
          )
          ]
        ),
        Option(
          name: '--json',
          description: 'The output in JSON format'
        ),
        Option(
          name: '--name',
          description: 'The name of the generate project',
          args: [
            Arg(
            name: 'name'
          )
          ]
        ),
        Option(
          name: '--platform',
          description: 'The platform used by the project',
          args: [
            Arg(
            name: 'platform'
          )
          ]
        )
      ]
    ),
    Subcommand(
      name: 'test',
      description: 'Tests a project. For more info see https://docs.tuist.io/commands/test USAGE: tuist test [<scheme>] [--clean] [--path <path>] [--device <device>] [--os <os>] [--configuration <configuration>] [--skip-ui-tests] [--result-bundle-path <result-bundle-path>] [--retry-count <retry-count>]',
      args: [
        Arg(
        name: 'scheme',
        description: 'The scheme to be tested. By default it tests all the testable targets of the project in the current directory'
      )
      ],
      options: [

        Option(
          name: ['--path', '-p'],
          description: 'The path to the directory that contains the project to be tested',
          args: [
            Arg(
            name: 'path',
            template: 'folders'
          )
          ]
        ),
        Option(
          name: ['--clean', '-c'],
          description: 'When passed, it cleans the project before testing it'
        ),
        Option(
          name: ['--device', '-d'],
          description: 'Test on a specific device',
          args: [
            Arg(
            name: 'device'
          )
          ]
        ),
        Option(
          name: ['--os', '-o'],
          description: 'Test with a specific version of the OS',
          args: [
            Arg(
            name: 'os'
          )
          ]
        ),
        Option(
          name: ['--configuration', '-C'],
          description: 'The configuration to be used when testing the scheme'
        ),
        Option(
          name: '--skip-ui-tests',
          description: 'When passed, it skips testing UI Tests targets'
        ),
        Option(
          name: ['--result-bundle-path', '-T'],
          description: 'Path where test result bundle will be saved'
        ),
        Option(
          name: '--retry-count',
          description: 'Tests will retry <number> of times until success. Example: if 1 is specified, the test will be retried at most once, hence it will run up to 2 times. (default: 0)',
          args: [
            Arg(
            name: 'times',
            defaultValue: '0'
          )
          ]
        )
      ]
    )
  ],
  options: [

    Option(
      name: ['--help', '-h'],
      description: 'Show help for tuist'
    )
  ]
);