Skip to content

add logic to prompt for PD teams#274

Closed
Mhodesty wants to merge 1 commit into
clcollins:mainfrom
Mhodesty:add-function-to-add-teams
Closed

add logic to prompt for PD teams#274
Mhodesty wants to merge 1 commit into
clcollins:mainfrom
Mhodesty:add-function-to-add-teams

Conversation

@Mhodesty
Copy link
Copy Markdown
Contributor

@Mhodesty Mhodesty commented Jun 5, 2026

Improve config creation and add interactive team selection

Changes

Fix srepd config --create to actually create the file

  • Previously just printed example config to stdout
  • Now creates ~/.config/srepd/ directory if needed
  • Writes srepd.yaml with example configuration
  • Prevents overwriting existing config files

Add srepd config --list-teams command

  • Fetches teams from PagerDuty API for current user
  • Shows only teams you're a member of (not all teams in org)
  • Displays team IDs and names ready for config

Interactive team selection on first startup

  • Detects placeholder teams in config on first run
  • Prompts: "No teams found in config. This will result in zero tickets loaded in srepd. Would you like to add your teams now?"
  • Allows multi-select (comma-separated: 1,3,5)
  • Surgically updates config file preserving all comments and formatting
  • Automatically updates teams section without touching other config

Before:

$ srepd config --create
# Example srepd configuration file
...

After:
$ srepd config --create
Config file created at /Users/user/.config/srepd/srepd.yaml
Please edit the file to add your PagerDuty credentials and team information.

Tip: After adding your token, run 'srepd config --list-teams' to see available teams.

Workflow

1. Run srepd config --create to create initial config
2. Add PagerDuty API token to config file
3. Run srepd - automatically prompts for team selection
4. Or manually run srepd config --list-teams to see teams first

@Mhodesty
Copy link
Copy Markdown
Contributor Author

Mhodesty commented Jun 5, 2026

/retest

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.

1 participant