···146146tunein play s221580
147147```
148148149149+## ๐ง Systemd Service
150150+151151+Tunein daemon can be started as a systemd service. To enable and start the service, run the following command:
152152+153153+```bash
154154+tunein service install
155155+```
156156+157157+To disable and stop the service, run the following command:
158158+159159+```bash
160160+tunein service uninstall
161161+```
162162+163163+To check the status of the service, run the following command:
164164+165165+```bash
166166+tunein service status
167167+```
168168+169169+149170## API Documentation
150171[https://buf.build/tsiry/tuneinserverapis/docs/main:tunein.v1alpha1](https://buf.build/tsiry/tuneinserverapis/docs/main:tunein.v1alpha1)
151172
+26
src/main.rs
···1313mod provider;
1414mod search;
1515mod server;
1616+mod service;
1617mod tags;
1718mod tui;
1819mod types;
···5859 .about("Start the server")
5960 .arg(arg!([port] "The port to listen on").default_value("8090")),
6061 )
6262+ .subcommand(
6363+ Command::new("service")
6464+ .about("Manage systemd service for tunein-cli server")
6565+ .subcommand(
6666+ Command::new("install")
6767+ .about("Install systemd service for tunein-cli server")
6868+ )
6969+ .subcommand(
7070+ Command::new("uninstall")
7171+ .about("Uninstall systemd service for tunein-cli server")
7272+ )
7373+ .subcommand(
7474+ Command::new("status")
7575+ .about("Check status of tunein-cli systemd service")
7676+ )
7777+ )
6178}
62796380#[tokio::main]
···93110 let port = port.parse::<u16>().unwrap();
94111 server::exec(port).await?;
95112 }
113113+ Some(("service", sub_m)) => match sub_m.subcommand() {
114114+ Some(("install", _)) => service::install()?,
115115+ Some(("uninstall", _)) => service::uninstall()?,
116116+ Some(("status", _)) => service::status()?,
117117+ _ => {
118118+ println!("Invalid subcommand. Use `tunein service --help` for more information");
119119+ std::process::exit(1);
120120+ }
121121+ },
96122 _ => unreachable!(),
97123 }
98124