mirror of
https://github.com/router-for-me/EasyCLI.git
synced 2026-04-25 07:35:51 +03:00
[PR #11] [MERGED] feat: Make CLIProxyAPI run as detached background process #29
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/EasyCLI#29
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/router-for-me/EasyCLI/pull/11
Author: @benzntech
Created: 10/24/2025
Status: ✅ Merged
Merged: 10/25/2025
Merged by: @luispater
Base:
main← Head:feature/background-process-detachment📝 Commits (1)
b6e742dfeat: Make CLIProxyAPI run as detached background process📊 Changes
3 files changed (+105 additions, -46 deletions)
View changed files
📝
src-tauri/Cargo.lock(+1 -0)📝
src-tauri/Cargo.toml(+3 -0)📝
src-tauri/src/main.rs(+101 -46)📄 Description
Overview
This PR implements independent background process execution for CLIProxyAPI, allowing the CLI service to continue running after the EasyCLI GUI application is closed.
Changes
Process Detachment
DETACHED_PROCESSflag (0x00000008) to create independent processsetsid()to create new session and process groupPID Tracking
PROCESS_PIDstatic for storing process IDUpdated Behaviors
Dependencies
libc = "0.2"for Unix platforms (setsid/kill functions)CommandExtimportsBenefits
✅ CLI service continues serving API requests after GUI exit
✅ Better separation of concerns (GUI vs service)
✅ Matches typical daemon/service behavior expectations
✅ Allows GUI to be used for configuration without disrupting service
Breaking Changes
⚠️ Important: Users must manually stop CLIProxyAPI using:
kill <PID>orps aux | grep cli-proxy-apitaskkill /F /PID <PID>or Task ManagerProcess no longer automatically stops when app closes.
Testing
Technical Details
See implementation in
src-tauri/src/main.rs:🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.