config

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ConfigPath = "~/.95cli/config.json"
View Source
const DefaultAPIURL = "https://api.95ninefive.dev"

DefaultAPIURL is the production API endpoint

View Source
const LocalAPIURL = "http://localhost:8080"

LocalAPIURL is the development API endpoint

Variables

This section is empty.

Functions

func Clear

func Clear() error

func DetectLanguage

func DetectLanguage(runCommand string) string

DetectLanguage detects programming language from run command

func Init

func Init()

func SaveProjectConfig

func SaveProjectConfig(runCommand string, language string) error

SaveProjectConfig writes runCommand and language to config.json in current directory

Types

type Config

type Config struct {
	APIUrl       string `json:"api_url" mapstructure:"api_url"`
	AccessToken  string `json:"access_token" mapstructure:"access_token"`
	RefreshToken string `json:"refresh_token" mapstructure:"refresh_token"`
	UserId       int    `json:"user_id" mapstructure:"user_id"`
	Username     string `json:"username" mapstructure:"username"`
}

func Load

func Load() (*Config, error)

func (*Config) GetAPIURL

func (cfg *Config) GetAPIURL() string

GetAPIURL returns the API URL from config, environment variable, or default Priority: 1. Config file 2. API_URL env var 3. Default production URL

func (*Config) Save

func (cfg *Config) Save() error

type ProjectConfig

type ProjectConfig struct {
	RunCommand string `json:"runCommand"`
	Language   string `json:"language"`
}

func LoadProjectConfig

func LoadProjectConfig() (*ProjectConfig, error)

LoadProjectConfig reads .95cli-project.json from current directory

Jump to

Keyboard shortcuts

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