We love the shell. bash or zsh or fish or powershell or name
your own. But the shell forgets, especially when we are across multiple
systems. It would be incredible if the shell could safely remember things for us,
across systems. So let us extend the shell to remember things for us.
The overall system will probably have multiple components. It may also need to handle some of the nuances of each shell. But we love to keep things simple. So, let us first build a simple API that can store the typed commands.
- The API should be able to store the commands typed by the user.
- The API should be able to search the command history by keyword.
For example, the following command should store a command:
curl -X POST http://localhost:8080/api/v1/commands -d "command=ls -l"Example command to search history:
curl -X GET http://localhost:8080/api/v1/commands?keyword=ls
⚠️ Should we enforce a minimum length for the command?
- Feel free to use any programming language
- Use a database, not just an in-memory list or map
Note: Any database is fine. Even in-memory
sqlite.
The reviewer should be able to run your application using
docker-compose. Additional steps are fine but should be documented.
- Create a private fork of this repository.
- Commit your code to the forked repository
devbranch - Create a pull request from your
devbranch to yourmainbranch - Invite @abhisek to your private fork repository
- Add
@abhisekas a reviewer to the pull request
Create an issue