How to use the @heroku-cli/command.flags.team function in @heroku-cli/command

To help you get started, we’ve selected a few @heroku-cli/command examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github heroku / heroku-apps / src / commands / apps / create.js View on Github external
{name: 'app', char: 'a', hasValue: true, hidden: true},
    {name: 'addons', hasValue: true, description: 'comma-delimited list of addons to install'},
    {name: 'buildpack', char: 'b', hasValue: true, description: 'buildpack url to use for this app', completion: BuildpackCompletion},
    {name: 'manifest', char: 'm', hasValue: false, description: 'use heroku.yml settings for this app', hidden: true},
    {name: 'no-remote', char: 'n', description: 'do not create a git remote'},
    {name: 'remote', char: 'r', hasValue: true, description: 'the git remote to create, default "heroku"', completion: RemoteCompletion},
    {name: 'stack', char: 's', hasValue: true, description: 'the stack to create the app on', completion: StackCompletion},
    {name: 'space', hasValue: true, description: 'the private space to create the app in', completion: SpaceCompletion},
    {name: 'region', hasValue: true, description: 'specify region for the app to run in', completion: RegionCompletion},
    {name: 'ssh-git', description: 'use SSH git protocol for local git remote'},
    {name: 'internal-routing', hidden: true, description: 'private space-only. create as an Internal Web App that is only routable in the local network.'},
    {name: 'kernel', hidden: true, hasValue: true},
    {name: 'locked', hidden: true},
    {name: 'json', description: 'output in json format'},
    // flags.org({name: 'org', hasValue: true}),
    flags.team({name: 'team', hasValue: true})
  ],
  run: cli.command(run)
}

module.exports = [
  Object.assign({topic: 'apps', command: 'create'}, cmd),
  Object.assign({hidden: true, topic: 'create'}, cmd)
]
github heroku / heroku-apps / src / commands / apps / index.js View on Github external
=== My Apps
example
example2

=== Collaborated Apps
theirapp   other@owner.name`,
  needsAuth: true,
  wantsOrg: true,
  flags: [
    {name: 'all', char: 'A', description: 'include apps in all teams'},
    {name: 'json', description: 'output in json format'},
    {name: 'space', char: 's', hasValue: true, description: 'filter by space', completion: SpaceCompletion},
    {name: 'personal', char: 'p', description: 'list apps in personal account when a default team is set'},
    {name: 'internal-routing', hidden: true, char: 'i', description: 'filter to Internal Web Apps'},
    // flags.org({name: 'org', hasValue: true}),
    flags.team({name: 'team', hasValue: true})
  ],
  run: cli.command(co.wrap(run))
}

module.exports = [
  Object.assign({topic: 'apps'}, cmd),
  Object.assign({topic: 'list', hidden: true}, cmd),
  Object.assign({topic: 'apps', command: 'list', hidden: true}, cmd)
]
github heroku / cli / packages / orgs-v5 / commands / members / set.js View on Github external
let role = context.flags.role

  yield Utils.addMemberToTeam(email, role, groupName, heroku, 'PATCH')
  yield Utils.warnIfAtTeamMemberLimit(teamInfo, groupName, context, heroku)
}

let set = {
  topic: 'members',
  command: 'set',
  description: 'sets a members role in a team',
  needsAuth: true,
  wantsOrg: true,
  args: [{ name: 'email' }],
  flags: [
    { name: 'role', char: 'r', hasValue: true, required: true, description: 'member role (admin, collaborator, member, owner)', completion: RoleCompletion },
    flags.team({ name: 'team', hasValue: true, hidden: true })
  ],
  run: cli.command(co.wrap(run))
}

module.exports = set
github heroku / cli / packages / pipelines-v5 / commands / pipelines / setup.js View on Github external
needsAuth: true,
  wantsOrg: true,
  args: [
    {
      name: 'name',
      description: 'name of pipeline',
      optional: true
    },
    {
      name: 'repo',
      description: 'a GitHub repository to connect the pipeline to',
      optional: true
    }
  ],
  flags: [
    flags.team({ name: 'team', hasValue: true, description: 'the team which will own the apps (can also use --org)' }),
    {
      name: 'yes',
      char: 'y',
      description: 'accept all default settings without prompting',
      hasValue: false
    }
  ],
  run: cli.command(co.wrap(function * (context, heroku) {
    const errors = Validate.nameAndRepo(context.args)

    if (errors.length) {
      cli.error(errors.join(', '))
      return
    }

    const kolkrabbi = new KolkrabbiAPI(context.version, heroku.options.token)
github heroku / cli / packages / spaces / commands / index.js View on Github external
if (context.flags.json) displayJSON(spaces)
  else if (spaces.length === 0) {
    if (team) throw new Error(`No spaces in ${cli.color.cyan(team)}.`)
    else throw new Error('You do not have access to any spaces.')
  } else {
    display(spaces)
  }
}

module.exports = {
  topic: 'spaces',
  description: 'list available spaces',
  needsAuth: true,
  flags: [
    { name: 'json', description: 'output in json format' },
    flags.team({ name: 'team', hasValue: true })
  ],
  run: cli.command(co.wrap(run))
}
github heroku / cli / packages / orgs-v5 / commands / members / remove.js View on Github external
if (teamInviteFeatureEnabled && isInvitedUser) {
    yield revokeInvite()
  } else {
    yield removeUserMembership()
  }
}

module.exports = {
  topic: 'members',
  command: 'remove',
  description: 'removes a user from a team',
  needsAuth: true,
  wantsOrg: true,
  args: [{ name: 'email' }],
  flags: [
    flags.team({ name: 'team', hasValue: true, hidden: true })
  ],
  run: cli.command(co.wrap(run))
}
github heroku / cli / packages / spaces / commands / index.js View on Github external
else if (spaces.length === 0) {
    if (team) throw new Error(`No spaces in ${cli.color.cyan(team)}.`)
    else throw new Error('You do not have access to any spaces.')
  } else {
    display(spaces)
  }
}

module.exports = {
  topic: 'spaces',
  description: 'list available spaces',
  needsAuth: true,
  wantsOrg: true,
  flags: [
    { name: 'json', description: 'output in json format' },
    flags.team({ name: 'team', hasValue: true })
  ],
  run: cli.command(co.wrap(run))
}
github heroku / cli / packages / pipelines-v5 / commands / pipelines / create.js View on Github external
The stage of the app will be guessed based on its name if not specified.
The pipeline owner will be the user creating the pipeline if not specified with -t for teams or -o for orgs.`,
  examples: `$ heroku pipelines:create -a example-staging
? Pipeline name: example
? Stage of example-staging: staging
Creating example pipeline... done
Adding example-staging to example pipeline as staging... done`,
  needsApp: true,
  needsAuth: true,
  wantsOrg: true,
  args: [
    { name: 'name', description: 'name of pipeline, defaults to basename of app', optional: true }
  ],
  flags: [
    { name: 'stage', char: 's', description: 'stage of first app in pipeline', hasValue: true },
    flags.team({ name: 'team', hasValue: true, description: 'the team which will own the apps (can also use --org)' })
  ],
  run: cli.command(co.wrap(run))
}
github heroku / cli / packages / orgs-v5 / commands / members / index.js View on Github external
{ key: 'status', label: 'Status', format: r => cli.color.green(r) }
      ]
    })
  }
}

module.exports = {
  topic: 'members',
  description: 'list members of a team',
  needsAuth: true,
  wantsOrg: true,
  flags: [
    { name: 'role', char: 'r', hasValue: true, description: 'filter by role', completion: RoleCompletion },
    { name: 'pending', hasValue: false, description: 'filter by pending team invitations' },
    { name: 'json', description: 'output in json format' },
    flags.team({ name: 'team', hasValue: true, hidden: true })
  ],
  run: cli.command(co.wrap(run))
}
github heroku / cli / packages / pipelines / src / commands / pipelines / create.ts View on Github external
static examples = [
    '$ heroku pipelines:create -a my-app-staging',
    '$ heroku pipelines:create my-pipeline -a my-app-staging',
  ]

  static flags = {
    app: flags.app({required: true}),
    remote: flags.remote(),
    stage: flags.string({
      name: 'stage',
      char: 's',
      description: 'stage of first app in pipeline',
      completion: StageCompletion,
    }),
    team: flags.team({
      description: 'the team which will own the apps',
    }),
  }

  static args = [{
    name: 'name',
    description: 'name of pipeline (defaults to basename of the app)',
    required: false,
  }]

  async run() {
    const {args, flags} = this.parse(Create)

    let name
    let stage
    let owner: any