To work with Chainlink price feeds in your local environment and deployment framework, you'll want to fork a blockchain.
I've included using hardhat and brownie in this answer as they have forking that comes already installed.
For just ganache
The easiest way is to use the forking feature.
ganache-cli --fork=http://infura.io/mainnet
When you run the client, you can fork mainnet and then just use the price feed contract addresses as normal but on your local chain.
For truffle
Truffle has two options:
1. Truffle teams forking
2. Write your own ganache-cli server
Truffle doesn't come pre-installed with a forking feature, but you can sign up for truffle teams and use a forking feature through that. Or, you could write your own server.
Hardhat is a truffle-like smart contract deployment and testing framework. It comes with a forking feature that forks a blockchain to it's hardhat virtual environment (similar to ganache local blockchain). In your hardhat config, you just write the following:
networks: {
hardhat: {
forking: {
url: "https://eth-mainnet.alchemyapi.io/v2/<key>"
}
}
}
Additionally, you can run a hardhat local chain with the command:
npx hardhat node --fork https://eth-mainnet.alchemyapi.io/v2/<key>
Brownie
Brownie is a python deployment framework that also has forking. You can check out the documentation if you'd like to learn more.