Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches: [main, master]

env:
BINARY_NAME: proxy-convert
BINARY_NAME: subforge
RUST_BACKTRACE: 1

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'v*'

env:
BINARY_NAME: proxy-convert
BINARY_NAME: subforge
RUST_BACKTRACE: 1

jobs:
Expand Down
58 changes: 29 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[package]
name = "proxy-convert"
name = "subforge"
version = "2.0.0"
edition = "2021"
authors = ["Messica <Messica@example.com>"]
description = "A modern, extensible tool for converting between different proxy configuration formats with multi-input integration support (Clash, Sing-box, V2Ray, etc.)"
description = "A modern, extensible tool for forging unified proxy configurations from multiple subscription sources (Clash, Sing-box, V2Ray, etc.) with template-driven node selection."
license = "MIT"
repository = "https://github.com/picopock/proxy-convert"
keywords = ["proxy", "clash", "sing-box", "v2ray", "subscription", "converter", "configuration", "multi-input", "integration"]
repository = "https://github.com/bitxwave/subforge"
keywords = ["proxy", "clash", "sing-box", "v2ray", "subscription"]
categories = ["command-line-utilities", "network-programming"]

[lib]
name = "proxy_convert"
name = "subforge"
path = "src/lib.rs"

[dependencies]
Expand Down Expand Up @@ -50,7 +50,7 @@ tempfile = "3.23"
wiremock = "0.6"

[[bin]]
name = "proxy-convert"
name = "subforge"
path = "src/main.rs"

[profile.release]
Expand Down
46 changes: 24 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Proxy Config Converter
# SubForge

A modern, extensible proxy configuration conversion tool supporting conversion and multi-source integration between various proxy configuration formats.
> Forge unified proxy configurations from multiple subscription sources.

A modern, extensible Rust CLI that merges multiple proxy subscription sources (Clash, Sing-box, V2Ray, etc.) into a single configuration via template-driven node selection.

## 🚀 Features

Expand All @@ -21,15 +23,15 @@ A modern, extensible proxy configuration conversion tool supporting conversion a
### Build from source

```bash
git clone https://github.com/your-username/proxy-convert.git
cd proxy-convert
git clone https://github.com/bitxwave/subforge.git
cd subforge
cargo build --release
```

### Install via Cargo

```bash
cargo install --git https://github.com/your-username/proxy-convert.git
cargo install --git https://github.com/bitxwave/subforge.git
```

## 🎯 Quick Start
Expand All @@ -38,20 +40,20 @@ cargo install --git https://github.com/your-username/proxy-convert.git

```bash
# Recommended: URL-style (path/url + query params)
proxy-convert convert --source "./clash.yaml?type=clash"
proxy-convert convert --source "https://example.com/sub?type=clash&name=my&flag=clash" -o config.json
subforge convert --source "./clash.yaml?type=clash"
subforge convert --source "https://example.com/sub?type=clash&name=my&flag=clash" -o config.json

# Legacy: name@type@source or type@source
proxy-convert convert --source "clash1@clash@./clash.yaml" --source "singbox1@sing-box@./singbox.json" -o config.json
subforge convert --source "clash1@clash@./clash.yaml" --source "singbox1@sing-box@./singbox.json" -o config.json

# Validate config file
proxy-convert validate config.json
subforge validate config.json

# Generate template
proxy-convert template singbox --output template.json
subforge template singbox --output template.json

# Show version info
proxy-convert version
subforge version
```

## 🔧 Multi-Source Mode
Expand Down Expand Up @@ -212,7 +214,7 @@ When using `source-name@tag` format, the final node tags automatically include s
### `convert` - Convert config format

```bash
proxy-convert convert [OPTIONS] --source <SOURCE> [--source <SOURCE>...]
subforge convert [OPTIONS] --source <SOURCE> [--source <SOURCE>...]
```

**Arguments:**
Expand All @@ -231,7 +233,7 @@ proxy-convert convert [OPTIONS] --source <SOURCE> [--source <SOURCE>...]
### `validate` - Validate config format

```bash
proxy-convert validate <FILE> [OPTIONS]
subforge validate <FILE> [OPTIONS]
```

**Arguments:**
Expand All @@ -245,7 +247,7 @@ proxy-convert validate <FILE> [OPTIONS]
### `template` - Generate template

```bash
proxy-convert template [OPTIONS]
subforge template [OPTIONS]
```

**Options:**
Expand All @@ -256,7 +258,7 @@ proxy-convert template [OPTIONS]
### `version` - Show version info

```bash
proxy-convert version
subforge version
```

## ⚙️ Configuration
Expand All @@ -266,21 +268,21 @@ proxy-convert version
The program will look for config files in the following order:

1. `config.yaml` or `config.yml` in the current directory
2. `proxy-convert/config.yaml` or `config.yml` in the user config directory
2. `subforge/config.yaml` or `config.yml` in the user config directory

### Config Example

```yaml
# config.yaml
user_agent: "ProxyConfigConverter/3.0.0"
user_agent: "SubForge/2.0.0"
timeout_seconds: 30
retry_count: 3
cache_ttl_seconds: 3600
log_level: info
output_format: json
default_input_format: clash
default_output_format: singbox
template_dir: ~/.config/proxy-convert/templates
template_dir: ~/.config/subforge/templates
# sources: same format as --source, e.g. ["path?type=clash&name=my"]
# sources:
# - "./clash.yaml?type=clash&name=clash1"
Expand All @@ -289,12 +291,12 @@ template_dir: ~/.config/proxy-convert/templates

### Environment Variables

All config items can be overridden by environment variables in the format `PROXY_CONVERT_<KEY>`:
All config items can be overridden by environment variables in the format `SUBFORGE_<KEY>`:

```bash
export PROXY_CONVERT_LOG_LEVEL=debug
export PROXY_CONVERT_TIMEOUT_SECONDS=60
export PROXY_CONVERT_DEFAULT_OUTPUT_FORMAT=v2ray
export SUBFORGE_LOG_LEVEL=debug
export SUBFORGE_TIMEOUT_SECONDS=60
export SUBFORGE_DEFAULT_OUTPUT_FORMAT=v2ray
```

## 🏗️ Project Structure
Expand Down
44 changes: 23 additions & 21 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Proxy Config Converter
# SubForge

一个现代化、可扩展的代理配置转换工具,支持多种代理配置格式之间的转换和多输入整合。
> 多源订阅锻造为一份统一代理配置。

现代化、可扩展的 Rust CLI 工具:把多个代理订阅源(Clash、Sing-box、V2Ray 等)按模板规则锻造成一份统一的代理配置。

## 📑 目录

Expand Down Expand Up @@ -34,15 +36,15 @@
### 源码编译

```bash
git clone https://github.com/your-username/proxy-convert.git
cd proxy-convert
git clone https://github.com/bitxwave/subforge.git
cd subforge
cargo build --release
```

### 使用 Cargo 安装

```bash
cargo install --git https://github.com/your-username/proxy-convert.git
cargo install --git https://github.com/bitxwave/subforge.git
```

## 🎯 快速开始
Expand All @@ -54,7 +56,7 @@ cargo install --git https://github.com/your-username/proxy-convert.git
- 转换订阅

```bash
proxy-convert convert [OPTIONS] --source <SOURCE> [--source <SOURCE>...]
subforge convert [OPTIONS] --source <SOURCE> [--source <SOURCE>...]
```

**选项:**
Expand Down Expand Up @@ -82,40 +84,40 @@ cargo install --git https://github.com/your-username/proxy-convert.git
- **验证配置文件**:验证配置文件的格式

```bash
proxy-convert validate <FILE> [-f, --format <FORMAT>]
subforge validate <FILE> [-f, --format <FORMAT>]
```

- **生成模板**:

```bash
proxy-convert template [-o, --output <OUTPUT>] [-t, --template-type <TYPE>]
subforge template [-o, --output <OUTPUT>] [-t, --template-type <TYPE>]
```

- **显示版本信息**:

```bash
proxy-convert version
subforge version
```

#### 使用示例

```bash
# 单源
proxy-convert convert --source "./clash.yaml?type=clash"
subforge convert --source "./clash.yaml?type=clash"

# 多源(可带 name、flag)
proxy-convert convert \
subforge convert \
--source "https://example.com/sub?type=clash&name=my&flag=clash" \
--source "examples/sources/Eternal Network?type=singbox" \
-o config.json

# 使用配置文件(sources 格式与 --source 一致)
proxy-convert convert --config examples/config.yaml -o config.json
subforge convert --config examples/config.yaml -o config.json

# 其他命令
proxy-convert validate config.json
proxy-convert template singbox --output template.json
proxy-convert version
subforge validate config.json
subforge template singbox --output template.json
subforge version
```

## 📋 插值规则系统 ✨
Expand Down Expand Up @@ -289,7 +291,7 @@ proxy-convert version
程序会按以下顺序查找配置文件:

1. 当前目录下的 `config.yaml` 或 `config.yml`
2. 用户配置目录下的 `proxy-convert/config.yaml` 或 `config.yml`
2. 用户配置目录下的 `subforge/config.yaml` 或 `config.yml`

**配置文件优先级:**

Expand All @@ -299,7 +301,7 @@ proxy-convert version

```yaml
# config.yaml
user_agent: "ProxyConfigConverter/3.0.0"
user_agent: "SubForge/2.0.0"
timeout_seconds: 30
retry_count: 3
log_level: info
Expand All @@ -325,12 +327,12 @@ default_output_format: singbox

### 环境变量

所有配置项均可通过环境变量覆盖,格式为 `PROXY_CONVERT_<KEY>`(嵌套键使用 `__`):
所有配置项均可通过环境变量覆盖,格式为 `SUBFORGE_<KEY>`(嵌套键使用 `__`):

```bash
export PROXY_CONVERT_LOG_LEVEL=debug
export PROXY_CONVERT_TIMEOUT_SECONDS=60
export PROXY_CONVERT_DEFAULT_OUTPUT_FORMAT=v2ray
export SUBFORGE_LOG_LEVEL=debug
export SUBFORGE_TIMEOUT_SECONDS=60
export SUBFORGE_DEFAULT_OUTPUT_FORMAT=v2ray
```

**配置优先级:** 命令行 > 环境变量 > 配置文件 > 默认值
Expand Down
Loading
Loading