mediar-ai / screenpipe

rewind.ai x cursor.com = your AI assistant that has all the context. 24/7 screen & voice recording for the age of super intelligence. get your data ready or be left behind
https://screenpi.pe
MIT License
9.61k stars 559 forks source link

feat: add screenpipe cli to PATH #658

Closed divanshu-go closed 1 week ago

divanshu-go commented 1 week ago

name: pull request about: submit changes to the project title: "[PR] Feat: Add Screenpipe CLI to PATH " labels: '' assignees: ''


description

This PR adds functionality to check whether the Screenpipe CLI is in the system PATH and automatically persists it if necessary. The changes ensure that screenpipe is easily accessible after installation without requiring manual path updates.

Closes #421

type of change

how to test

  1. download screenpipe binary or build from source
  2. do screenpipe or screenpipe setup
  3. make sure to follow instructions in output
  4. Open a new terminal session and verify that screenpipe is available in the system PATH by running which screenpipe or On Windows do where screenpipe

checklist

vercel[bot] commented 1 week ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
screenpipe ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 9, 2024 4:20pm
louis030195 commented 1 week ago

cool thanks!

/tip $40 @divanshu-go

algora-pbc[bot] commented 1 week ago

🎉🎈 @divanshu-go has been awarded $40! 🎈🎊

tribhuwan-kumar commented 1 week ago

@divanshu-go what does this mean?

2024-11-11T13:55:01.711915Z ERROR screenpipe: screenpipe PATH check failed: the PATH is too long to persist using 'setx'. please shorten the PATH.
2024-11-11T13:55:01.711934Z ERROR screenpipe: please ensure screenpipe is installed correctly and is in your PATH
divanshu-go commented 1 week ago

@tribhuwan-kumar we are using setx on windows to set PATH and maybe your PATH is already above the limit of 1024 . therefore It is not able to update(persist) the screenpipe binary path into it. You can shorten your PATH if you want it to set up your PATH

tribhuwan-kumar commented 1 week ago

@tribhuwan-kumar we are using setx on windows to set PATH and maybe your PATH is already above the limit of 1024 . therefore It is not able to update(persist) the screenpipe binary path into it. You can shorten your PATH if you want it to set up your PATH

so there is character limit but it should be more like a warning, it doesn't let run screenpipe without adding in path.

divanshu-go commented 1 week ago

@tribhuwan-kumar can you suggest a fix because this limit is set by Microsoft and I can not do anything besides you shorten your PATH

divanshu-go commented 1 week ago

@tribhuwan-kumar you can always run the app using absolute path of binary if you do not want to set PATH

tribhuwan-kumar commented 1 week ago

@tribhuwan-kumar can you suggest a fix because this limit is set by Microsoft and I can not do anything besides you shorten your PATH

can you make it something like this, if setx path limit exceeds it simply skip to set screenpipe in path (only for windows) bcz in app when path exceeds (bun tauri dev), it doesn't let run screenpipe . maybe @louis030195 can suggest something

ps: this can be fixed by adding these line

    if current_path.len() + new_path.to_str().unwrap_or("").len() + 1 > 1024 {
        debug!("the PATH is too long to persist using 'setx', skipping setting screenpipe in PATH.");
        return Ok(());
    }

here: https://github.com/mediar-ai/screenpipe/blob/4dd5a053186e3bad70178c08ce58f7df8b24f82d/screenpipe-server/src/bin/screenpipe-server.rs#L936

louis030195 commented 1 week ago

@tribhuwan-kumar i removed the return that was preventing to run screenpipe

if it fails to add to path it shouldn't prevent running the main features