Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maxcnunes/slack-files
Easy control over the Slack files clean up
https://github.com/maxcnunes/slack-files
Last synced: 27 days ago
JSON representation
Easy control over the Slack files clean up
- Host: GitHub
- URL: https://github.com/maxcnunes/slack-files
- Owner: maxcnunes
- Created: 2016-08-27T00:33:59.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-24T16:58:53.000Z (about 8 years ago)
- Last Synced: 2024-10-15T15:47:12.635Z (30 days ago)
- Language: Go
- Homepage:
- Size: 86.9 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# slack-files
**Control over the Slack files clean up**
If you don't have budget to pay for a slack account you probably will need starting to delete files once you get the storage out of space. This CLI is just a simple solution to help find out the largest files in your account.
![](https://raw.githubusercontent.com/maxcnunes/slack-files/master/slack-files.png)
**Important!**
This CLI uses 2 different APIs to fetch the files from Slack.
On using the args:* `--query`: It will fetch the files from https://api.slack.com/methods/search.files
* `--types` and `--days-to`: Will fetch from https://api.slack.com/methods/files.listAlthough on using multiple args from different APIs it will gather the data. It will not apply the criteria from one API to another.
For instance on filtering by query and days-to. The data from search.files API will not be filtered by the days.
This is a limitation I will keep this way at least initially to simplify the implementation of the CLI.But no worries. The CLI will ask you to confirm before deleting any file. Also is possible to backup the files.
### Download
[Releases](https://github.com/maxcnunes/slack-files/releases)
### Args
* **--query [string]**: Search query. Accept multiple values separated by `,`.
* **--token [string]**: Slack Authentication token.
* **--types [string]**: Filter files by type. Accept multiple values separated by `,`.
* **--days-to [int]**: Filter files created before this timestamp (inclusive).
* **--backup [string]**: Path to backup files before delete.**--types**
Valid types specified by Slack API https://api.slack.com/methods/files.list
* `all` - All files
* `spaces` - Posts
* `snippets` - Snippets
* `images` - Image files
* `gdocs` - Google docs
* `zips` - Zip files
* `pdfs` - PDF files#### Examples
**Filtering with query by multiple extensions**
```bash
--query ".rar,.tar,.zip,.mp3,.mp4,.pdf,.ppt,.csv,.jpeg,.json"
```**Filtering by files of all image types**
```bash
--types images
```**Filtering by all files older than 30 days**
```bash
--days-to 30
```**Filtering by files of all image types older than 30 days**
```bash
--types images --days-to 30
```## Development
```bash
go get -v ./...go run main.go --token
```## Build
Using [goxc](https://github.com/laher/goxc).
```bash
goxc
```