CircleCI Ideas

CLI `config create` command for generating new project configs

I think it'll be useful to add a create subcommand to config that allows the user to create new configs from scratch. Here's examples of how this might be use:

```

circleci config create [flags]

Flags:
--executor string Can be 'docker', 'machine', or 'macos'. Defaults to 'docker'.
--template string Path to a template file to be used when creating config.
```

I would image running `circleci config create` with defaults would:

1. Create the `./circleci` directory if it doesn't exists.
2. Create the file ./circleci/config.yml` if it doesn't exists.
3. Create a starting config like below:

```
version: 2.1
workflows:
main:
jobs:
- build

jobs:
build:
docker:
- image: cibuilds/base:2018.10
steps:
- checkout
- run:
name: "First Step"
command: echo "Run a Bash command."
```

When adding a new project to CircleCI, the webapp shows a config (very verbose though) that the user could use for that project based on language. In addition to or instead of `--template`, we could have a language keyboard that pulls that same config for the user to use it as a staring point.

 

This idea was originally proposed here:
https://github.com/CircleCI-Public/circleci-cli/issues/189

  • Avatar32.5fb70cce7410889e661286fd7f1897de Guest
  • Feb 12 2019
  • Taking votes
CLI
  • Attach files