cmd

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AirlinesCmd

type AirlinesCmd struct {
	Lookup AirlinesLookupCmd `cmd:"" name:"lookup" help:"Look up airline by IATA code"`
}

type AirlinesLookupCmd

type AirlinesLookupCmd struct {
	Code string `required:"" arg:"" help:"IATA airline code (e.g., BA, AA)"`
}

func (*AirlinesLookupCmd) Run

func (c *AirlinesLookupCmd) Run(g *Globals) error

type AirportsCmd

type AirportsCmd struct {
	Search AirportsSearchCmd `cmd:"" help:"Search airports by keyword (autocomplete)"`
}

type AirportsSearchCmd

type AirportsSearchCmd struct {
	Keyword string `required:"" arg:"" help:"Search keyword (e.g., 'london', 'JFK')"`
}

func (*AirportsSearchCmd) Run

func (c *AirportsSearchCmd) Run(g *Globals) error

type AuthCmd

type AuthCmd struct {
	Login  AuthLoginCmd  `cmd:"" help:"Authenticate with Amadeus API"`
	Status AuthStatusCmd `cmd:"" help:"Show authentication status"`
	Logout AuthLogoutCmd `cmd:"" help:"Remove stored credentials"`
}

type AuthLoginCmd

type AuthLoginCmd struct{}

func (*AuthLoginCmd) Run

func (c *AuthLoginCmd) Run(g *Globals) error

type AuthLogoutCmd

type AuthLogoutCmd struct{}

func (*AuthLogoutCmd) Run

func (c *AuthLogoutCmd) Run(g *Globals) error

type AuthStatusCmd

type AuthStatusCmd struct{}

func (*AuthStatusCmd) Run

func (c *AuthStatusCmd) Run(g *Globals) error

type CLI

type CLI struct {
	JSON        bool     `short:"j" name:"json" help:"Output as JSON" aliases:"machine"`
	Plain       bool     `short:"p" name:"plain" help:"Output as tab-separated values"`
	ResultsOnly bool     `name:"results-only" help:"Strip response metadata, return data array only"`
	Select      []string `name:"select" short:"s" help:"Select specific fields (dot-path)" aliases:"fields"`
	Test        bool     `name:"test" help:"Use test environment (test.api.amadeus.com)"`
	DryRun      bool     `name:"dry-run" help:"Show what would be done without making API calls"`
	NoInput     bool     `name:"no-input" help:"Never prompt for input"`
	Verbose     bool     `short:"v" name:"verbose" help:"Verbose output"`

	Auth      AuthCmd      `cmd:"" help:"Manage authentication"`
	Flights   FlightsCmd   `cmd:"" help:"Search and price flights"`
	Hotels    HotelsCmd    `cmd:"" help:"Search and book hotels"`
	Airports  AirportsCmd  `cmd:"" help:"Search airports"`
	Airlines  AirlinesCmd  `cmd:"" help:"Look up airlines"`
	Schema    SchemaCmd    `cmd:"" help:"Show CLI schema for agent introspection"`
	ExitCodes ExitCodesCmd `cmd:"" name:"exit-codes" help:"Show exit code reference"`
}

type ExitCodeEntry

type ExitCodeEntry struct {
	Code        int    `json:"code"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

func ExitCodeTable

func ExitCodeTable() []ExitCodeEntry

type ExitCodesCmd

type ExitCodesCmd struct{}

func (*ExitCodesCmd) Run

func (c *ExitCodesCmd) Run(g *Globals) error

type FlightsCmd

type FlightsCmd struct {
	Search  FlightsSearchCmd  `cmd:"" help:"Search for flight offers"`
	Price   FlightsPriceCmd   `cmd:"" help:"Confirm pricing for a flight offer"`
	Seatmap FlightsSeatmapCmd `cmd:"" help:"View seat map for a flight offer"`
}

type FlightsPriceCmd

type FlightsPriceCmd struct {
	OfferID string `required:"" name:"offer-id" help:"Flight offer ID from search results"`
}

func (*FlightsPriceCmd) Run

func (c *FlightsPriceCmd) Run(g *Globals) error

type FlightsSearchCmd

type FlightsSearchCmd struct {
	From        string `required:"" name:"from" help:"Origin IATA code (e.g., JFK)"`
	To          string `required:"" name:"to" help:"Destination IATA code (e.g., CDG)"`
	Date        string `required:"" name:"date" help:"Departure date (YYYY-MM-DD)"`
	Return      string `name:"return" help:"Return date for round-trip (YYYY-MM-DD)"`
	Adults      int    `name:"adults" default:"1" help:"Number of adults (1-9)"`
	Children    int    `name:"children" default:"0" help:"Number of children (0-9)"`
	TravelClass string `name:"class" help:"Travel class (ECONOMY, PREMIUM_ECONOMY, BUSINESS, FIRST)"`
	NonStop     bool   `name:"nonstop" help:"Direct flights only"`
	Currency    string `name:"currency" help:"Currency code (e.g., USD, EUR)"`
	MaxPrice    int    `name:"max-price" help:"Maximum price (no decimals)"`
	Max         int    `name:"max" default:"10" help:"Maximum number of results (1-250)"`
}

func (*FlightsSearchCmd) Run

func (c *FlightsSearchCmd) Run(g *Globals) error

type FlightsSeatmapCmd

type FlightsSeatmapCmd struct {
	OfferID string `required:"" name:"offer-id" help:"Flight offer ID from search results"`
}

func (*FlightsSeatmapCmd) Run

func (c *FlightsSeatmapCmd) Run(g *Globals) error

type Globals

type Globals struct {
	Ctx     context.Context
	Config  *config.Config
	OutOpts output.Options
	CLI     *CLI
	Version string
}

func NewGlobals

func NewGlobals(cli *CLI) (*Globals, error)

func (*Globals) NewAPIClient

func (g *Globals) NewAPIClient() (*api.Client, error)

type HotelsBookCmd

type HotelsBookCmd struct {
	OfferID    string `required:"" name:"offer-id" help:"Hotel offer ID from search results"`
	GuestName  string `required:"" name:"guest-name" help:"Guest full name"`
	GuestEmail string `required:"" name:"guest-email" help:"Guest email address"`
}

func (*HotelsBookCmd) Run

func (c *HotelsBookCmd) Run(g *Globals) error

type HotelsCmd

type HotelsCmd struct {
	Search HotelsSearchCmd `cmd:"" help:"Search hotels by city or location"`
	Offers HotelsOffersCmd `cmd:"" help:"Get offers for a specific hotel"`
	Book   HotelsBookCmd   `cmd:"" help:"Book a hotel offer"`
}

type HotelsOffersCmd

type HotelsOffersCmd struct {
	HotelID  string `required:"" name:"hotel-id" help:"Amadeus hotel ID"`
	CheckIn  string `required:"" name:"checkin" help:"Check-in date (YYYY-MM-DD)"`
	CheckOut string `required:"" name:"checkout" help:"Check-out date (YYYY-MM-DD)"`
	Adults   int    `name:"adults" default:"1" help:"Number of adults"`
	Rooms    int    `name:"rooms" default:"1" help:"Number of rooms"`
	Currency string `name:"currency" help:"Currency code"`
}

func (*HotelsOffersCmd) Run

func (c *HotelsOffersCmd) Run(g *Globals) error

type HotelsSearchCmd

type HotelsSearchCmd struct {
	City    string  `name:"city" help:"City IATA code (e.g., PAR)" xor:"location"`
	Lat     float64 `name:"lat" help:"Latitude" xor:"location"`
	Lng     float64 `name:"lng" help:"Longitude" xor:"location"`
	Radius  int     `name:"radius" default:"5" help:"Search radius in km"`
	Ratings []int   `name:"ratings" help:"Hotel ratings to filter (1-5)"`
}

func (*HotelsSearchCmd) Run

func (c *HotelsSearchCmd) Run(g *Globals) error

type SchemaCmd

type SchemaCmd struct {
	Command string `arg:"" optional:"" help:"Show schema for a specific command"`
}

func (*SchemaCmd) Run

func (c *SchemaCmd) Run(g *Globals) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL