smithery.ai

config-skill

This skill should be used when the user asks to "load", "parse configuration config file", "read properties file", "manage application settings", "switch environment config", "configure application", "?

First seen Apr 30, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,191 B
  • docs SUMMARY.md 426 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

配置文件管理

.properties 配置文件格式

Name=api-api
Port=31508
Mode=dev
Timeout=30000

# 数据库配置
InternalMysqlReader.Url=user01:password@tcp(192.168.4.14:3306)/odds_center?...
InternalMysqlReader.Debug=true
InternalMysqlReader.MaxOpen=100
InternalMysqlReader.MaxIdle=50

# Redis 配置
RedisConf.Host=192.168.4.7:30679
RedisConf.Pass=123456
RedisConf.Db=9

# RabbitMQ 配置
InternalRabbit.Url=amqp://guest:[email protected]:5672

配置结构体定义

type Config struct {
    rest.RestConf
    SourceRabbit        rabbitmq.RabbitConf `json:",optional"`
    InternalRabbit      rabbitmq.RabbitConf
    InternalMysqlReader cfg.MysqlConf
    InternalMysqlWriter cfg.MysqlConf
    RedisConf           cfg.RedisConf
    Pprof               cfg.PprofConf `json:",optional"`
    AliOss              cfg.AliOss
    AwsOss              cfg.AwsOss
    OssType             string `json:",optional"`
}

配置加载

// api.go
var configFiles = []string{"api/etc/api.properties"}
flag.Func("f", "the config file", func(s string) error {
    configFiles = []string{s}
    return nil
})

var c config.Config
if err := cfg.LoadProperties(configFiles, &c); err != nil {
    panic(err)
}

MySQL 配置

type MysqlConf struct {
    Url     string
    MaxOpen int  `json:",optional"`
    MaxIdle int  `json:",default=50"`
    Debug   bool `json:",default=false"`
}

Redis 配置

type RedisConf struct {
    Host string
    Pass string `json:",optional"`
    Tls  bool   `json:",optional"`
    Db   int    `json:",default=0"`
    Node string `json:",default=node,options=node|cluster"`
}

RabbitMQ 配置

type RabbitConf struct {
    Url string
}